chore: fix wrong key cache #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sanity Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
name: Setup Dependencies | |
runs-on: ubuntu-latest | |
outputs: | |
cache-key: ${{ steps.cache-node-modules.outputs.cache-key }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
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 | |
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: Run Type Check | |
run: yarn run typecheck | |
- name: Run Lint | |
run: yarn run lint | |
- name: Run Tests | |
run: yarn run test |