ci: optimize workflows and test commands #168
Workflow file for this run
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: Code health checks | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
NODE_VERSION: 22 | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache Yarn Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.yarn-cache | |
node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: yarn install | |
typecheck: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Type Checking | |
run: yarn typecheck | |
linting: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code Linting | |
run: yarn eslint:check | |
formatting: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code Formatting | |
run: yarn prettier:check | |
testing: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Unit Tests | |
run: yarn test |