Email send task #1956
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: API tests | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*.*.*' | |
branches: [master] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [master] | |
jobs: | |
run-tests: | |
name: Run API tests | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Copy env file | |
run: cp .env.example .env | |
- name: Run database | |
run: docker compose up -d pg-db | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Generate Prisma DB client | |
run: yarn prisma generate | |
- name: Migrate database | |
run: yarn prisma migrate deploy | |
- name: Seed database | |
run: yarn seed | |
- name: NX Build and lint API # https://github.com/marketplace/actions/nrwl-nx | |
uses: MansaGroup/nrwl-nx-action@v3 | |
with: | |
targets: lint,build | |
projects: api | |
- name: Run tests | |
run: yarn test:ci | |
- name: Upload test results artifact | |
uses: actions/upload-artifact@v4 # upload test results | |
if: success() || failure() # run this step even if previous step failed | |
with: # upload a combined archive with unit and integration test results | |
name: test-results | |
path: test-results.xml |