Skip to content

Commit

Permalink
chore(ci): 2 jobs and common composite
Browse files Browse the repository at this point in the history
  • Loading branch information
jdabbech-ledger committed Jan 5, 2024
1 parent be3574b commit e1be8d5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
name: pull_request
on: [pull_request]
jobs:
test:
lint:
runs-on: [device-sdk-4xlarge-linux]
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm
- uses: ./actions/setup-toolchain-composite

- name: Get pnpm store directory
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Lint
run: pnpm lint

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
test:
runs-on: [device-sdk-4xlarge-linux]
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: pnpm install
- uses: ./actions/setup-toolchain-composite

- name: Test
run: pnpm test
30 changes: 30 additions & 0 deletions actions/setup-toolchain-composite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Setup Device SDK toolchain"
description: "Composite job to setup the CI tools for Device SDK"

runs:
using: "composite"
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install

0 comments on commit e1be8d5

Please sign in to comment.