Skip to content

Commit

Permalink
chore: improve action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonours committed Nov 23, 2024
1 parent b187ad4 commit 9ddd227
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,55 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Sanity Checks Workflow
name: Sanity Checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
'sanity-checks':
setup:
name: Setup Dependencies
runs-on: ubuntu-latest

outputs:
cache-key: ${{ steps.cache-node-modules.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.11.0'
node-version: '22.x'

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable

- name: Typecheck
run: yarn typecheck
sanity-check:
name: Sanity Checks
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Restore node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ needs.setup.outputs.cache-key }}

- name: Lint Codebase
run: yarn lint
- name: Run Type Check
run: yarn run typecheck

- name: Tests
run: yarn test
- name: Run Lint
run: yarn run lint

- name: Build
run: yarn build
- name: Run Tests
run: yarn run test

0 comments on commit 9ddd227

Please sign in to comment.