Add first backend tests #1
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: Lint & test | |
on: | |
push: | |
branches: [dev] | |
pull_request: | |
branches: [dev] | |
types: [synchronize, opened, reopened, ready_for_review] | |
workflow_call: | |
jobs: | |
lint: | |
name: ESLint | |
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 7 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Run ESLint | |
run: npm run lint | |
typecheck: | |
name: Type checking | |
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 7 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Run type checking | |
run: npm run typecheck | |
test: | |
name: Tests | |
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 7 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Run tests | |
run: npm run test |