From cd58f962aec22c925b7df5140502978da8f87d5f Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:50:08 +0200 Subject: [PATCH] ci(github-actions): minor improvements (#908) * ci(github-actions): pin streetsidesoftware/cspell-action@v2 * ci(github-actions): add build step * ci(github-actions): add jest ci flag --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 739e1e41..98e5b076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,35 @@ name: CI on: ['push', 'pull_request'] jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: yarn install + if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here! + run: yarn install --frozen-lockfile --ignore-scripts + + - name: yarn build + run: yarn build + + env: + CI: true + lint: name: Lint runs-on: ubuntu-latest @@ -60,7 +89,7 @@ jobs: run: yarn install --frozen-lockfile --ignore-scripts - name: yarn test - run: yarn test --reporters="default" --reporters="github-actions" + run: yarn test --ci --reporters="default" --reporters="github-actions" env: CI: true @@ -101,7 +130,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: streetsidesoftware/cspell-action@main + - uses: streetsidesoftware/cspell-action@v2 with: # Github token used to fetch the list of changed files in the commit. # Default: ${{ github.token }}