Skip to content

Feat/transfer tickets #1308

Feat/transfer tickets

Feat/transfer tickets #1308

name: Graphql and Database Tests
on:
push:
branches:
- main
- release
pull_request:
jobs:
integration-test:
runs-on: ubuntu-latest
name: Integration Tests
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432/tcp
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: ⏳ Cloning repo
uses: actions/checkout@v4
with:
show-progress: false
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📦 Download Cached Package Dependencies
uses: actions/cache@v3
env:
cache-name: NPM
with:
path: ~/.npm
key: CACHE-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: 📥 Install dependencies
run: npm ci --prefer-offline --no-audit --legacy-peer-deps --cache ~/.npm
- name: Run tests
run: npm run test:ci
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port
- name: "Report Coverage"
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v2
with:
file-coverage-mode: "changes"
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: dist-without-markdown
path: |
./test_dbs