Skip to content

feat(api): add basic swagger to api (#116) #287

feat(api): add basic swagger to api (#116)

feat(api): add basic swagger to api (#116) #287

Workflow file for this run

name: API Unit/e2e Tests
on:
pull_request:
branches:
- dev
push:
branches:
- dev
jobs:
files-changed:
name: Files Changed check
runs-on: ubuntu-latest
outputs:
api: ${{ steps.changes.outputs.api }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
api:
- 'api/**'
api:
needs: files-changed
if: ${{ needs.files-changed.outputs.api == 'true' }}
runs-on: ubuntu-latest
env:
DATABASE_URL: 'postgresql://cinesync-dev:@BarelyAnInconvenience@@localhost:5432/cinesync-dev'
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
cache-dependency-path: api/package.json
- uses: docker/setup-buildx-action@v1
- name: Instantiate a Postgres db for e2e testing
run: docker compose up --build -d db
- name: Wait for Postgres become fully ready
run: npx --silent wait-on -t 10000 tcp:5432
- name: Apply database migrations and generate a prisma client
run: cd api && npm run db:migrate && npm run db:generate
- name: Run tests
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
MAILGUN_DOMAIN: ${{ secrets.MAILGUN_DOMAIN }}
MAILGUN_KEY: ${{ secrets.MAILGUN_KEY }}
run: |
cd api
npm install
npm run test
npm run test:e2e