chore(deps): bump node in /backend #100
Workflow file for this run
This file contains hidden or 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: Backend | |
permissions: | |
contents: read | |
on: | |
push: | |
paths: | |
- .github/workflows/backend.yaml | |
- backend/** | |
branches: | |
- '**' | |
tags-ignore: | |
- "**" | |
workflow_call: | |
defaults: | |
run: | |
working-directory: backend | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run build | |
check-generated-files: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: [reis, tools, executor] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run generate-${{ matrix.service }} | |
- run: git diff --quiet # exits with exitcode != 0 if changes are detected | |
check-generated-specs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run generate-openapi-dev | |
- run: git add -N . | |
- run: git diff . | |
- run: git diff --quiet . | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:17.5 | |
env: | |
POSTGRES_USER: admin | |
POSTGRES_PASSWORD: secret | |
POSTGRES_DB: cccc | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
env: | |
BASE_URL: 'https://example.com' | |
DB_URL: postgres://admin:secret@localhost:5432/cccc | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run test:cov | |
- uses: irongut/[email protected] | |
with: | |
badge: true | |
filename: backend/coverage/cobertura-coverage.xml | |
format: markdown | |
output: both | |
- run: cp code-coverage-results.md $GITHUB_STEP_SUMMARY | |
working-directory: . | |
test-migration: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:17.5 | |
env: | |
POSTGRES_USER: admin | |
POSTGRES_PASSWORD: secret | |
POSTGRES_DB: cccc | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
env: | |
BASE_URL: 'https://example.com' | |
DB_URL: postgres://admin:secret@localhost:5432/cccc | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
cache-dependency-path: backend/package-lock.json | |
- run: npm install | |
- run: npm run migration:run | |
# changes the return code from 1 to 0 in case no schema was changed and vice versa | |
- run: sh -c "! npm run migration:generate --name=test" |