-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 1 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Test the application
on: [pull_request]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate .env file
run: |
touch .env
echo "NGINX_PORT=${{ vars.NGINX_PORT }}" >> .env
echo "PUBLIC_API_URL=${{ vars.PUBLIC_API_URL }}" >> .env
echo "FRONTEND_PORT=${{ vars.FRONTEND_PORT }}" >> .env
echo "BACKEND_PORT=${{ vars.BACKEND_PORT }}" >> .env
echo "POSTGRES_USER=${{ vars.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ vars.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_DB=${{ vars.POSTGRES_DB }}" >> .env
- name: Build images
run: docker compose build
- name: Build frontend
run: docker compose run frontend npm run build
- name: Run backend unit tests
run: docker compose run backend yarn test
- name: Run backend e2e tests
run: docker compose run backend yarn test:e2e