Merge pull request #57 from MelleB/renovate/typescript-eslint-monorepo #170
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: CI Pipeline | |
permissions: | |
pull-requests: write | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: test_db | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd "pg_isready -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm install | |
- name: Run linter | |
run: npm run lint | |
- name: Wait for Postgres to be ready | |
run: | | |
until pg_isready -h localhost -p 5432 -U postgres; do | |
echo "Waiting for postgres..." | |
sleep 1 | |
done | |
- name: Run tests with coverage | |
run: npm run test:coverage | |
- name: 'Report Coverage' | |
# Set if: always() to also generate the report if tests are failing | |
# Only works if you set `reportOnFailure: true` in your vite config as specified above | |
if: always() | |
uses: davelosert/vitest-coverage-report-action@v2 | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage |