diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a2b454c77..9e73bee5a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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 diff --git a/actions/setup-toolchain-composite/action.yml b/actions/setup-toolchain-composite/action.yml new file mode 100644 index 000000000..ca73c97d5 --- /dev/null +++ b/actions/setup-toolchain-composite/action.yml @@ -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