Skip to content

feat:fe-issues 02-03-04-05-maintenance, locations, licenses, audits #4

feat:fe-issues 02-03-04-05-maintenance, locations, licenses, audits

feat:fe-issues 02-03-04-05-maintenance, locations, licenses, audits #4

Workflow file for this run

name: Backend CI
on:
pull_request:
branches:
- main
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
jobs:
test-and-build:
name: Backend Lint, Test & Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: assetsup_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run tests with coverage
env:
NODE_ENV: test
DB_HOST: localhost
DB_PORT: 5432
DB_USERNAME: postgres
DB_PASSWORD: postgrespassword
DB_NAME: assetsup_test
REDIS_HOST: localhost
REDIS_PORT: 6379
JWT_SECRET: test-secret-key
run: npm run test:cov
- name: Run production build
run: npm run build