#2770-getUserTasks #6853
Workflow file for this run
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
- 'feature/**' | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set env variables | |
run: touch .env && echo "FINANCE_TEAM_ID=0" >> .env | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
cache: 'yarn' | |
- name: Add Env Variables | |
run: cd src/backend && echo "DATABASE_URL=\"postgresql://postgres:docker@localhost:5432/nerpm?schema=public\"" >> .env | |
- name: Pull Docker Image | |
run: docker run --name finishline -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres | |
- name: Wait for Postgres to start | |
run: sleep 10s | |
- name: Create Database | |
run: docker exec finishline psql -U postgres -c "CREATE DATABASE nerpm;" | |
- name: Install modules | |
run: yarn install && yarn prisma:generate && yarn prisma:migrate:prod | |
- name: Run tests | |
run: yarn test:backend; yarn test:frontend |