Skip to content

Commit

Permalink
chore: add build to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonours committed Nov 23, 2024
1 parent c0a8416 commit 3736e97
Showing 1 changed file with 58 additions and 10 deletions.
68 changes: 58 additions & 10 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,91 @@ 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

- 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

0 comments on commit 3736e97

Please sign in to comment.