ci: simplify workflows #573
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: Node.js CI | |
on: | |
push: | |
branches: [master] | |
paths: | |
- "frontend/**" | |
- ".github/workflows/node.yml" | |
pull_request: | |
branches: [master] | |
paths: | |
- "frontend/**" | |
- ".github/workflows/node.yml" | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install npm dependencies | |
run: npm install | |
- name: Run tests | |
run: npm run test:unit | |
lint: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./frontend | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
cache-dependency-path: frontend/package-lock.json | |
- name: Install npm dependencies | |
run: npm install | |
- name: Run type-check | |
run: npm run type-check | |
- name: Run ESLint | |
run: NODE_ENV=production npm run lint |