From 3736e976f8a197cb911ffdbdaa32e702185cbe8f Mon Sep 17 00:00:00 2001 From: Anthony Guimard Date: Sat, 23 Nov 2024 15:42:06 +0100 Subject: [PATCH] chore: add build to ci --- .github/workflows/sanity-checks.yml | 68 ++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/.github/workflows/sanity-checks.yml b/.github/workflows/sanity-checks.yml index f3ce481..7eccee6 100644 --- a/.github/workflows/sanity-checks.yml +++ b/.github/workflows/sanity-checks.yml @@ -13,7 +13,7 @@ jobs: name: Setup Dependencies runs-on: ubuntu-latest outputs: - cache-key: ${{ steps.cache-node-modules.outputs.cache-key }} + cache-key: ${{ steps.cache-node-modules.outputs.cache-hit }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,35 +21,83 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '22.x' + node-version: '22.11.0' - name: Cache node_modules id: cache-node-modules uses: actions/cache@v4 with: path: node_modules - key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: yarn install --immutable - sanity-check: - name: Sanity Checks + typecheck: + name: Typecheck runs-on: ubuntu-latest needs: [setup] steps: - - name: Restore node_modules + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules from cache uses: actions/cache@v4 with: path: node_modules - key: ${{ needs.setup.outputs.cache-key }} + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} - - name: Run Type Check + - name: Check types run: yarn run typecheck - - name: Run Lint + lint: + name: Lint + runs-on: ubuntu-latest + needs: [typecheck] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules from cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Run ESLint run: yarn run lint - - name: Run Tests + test: + name: Test + runs-on: ubuntu-latest + needs: [lint] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules from cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Run tests run: yarn run test + + build: + name: Build + runs-on: ubuntu-latest + needs: [lint] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules from cache + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Run Build + run: yarn run build