Add code format check and linter check to CI #72
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
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 | |
- name: Run Code Format Check (Backend) | |
run: docker compose run backend npx -y prettier --check . | |
- name: Run Code Format Check (Frontend) | |
run: docker compose run frontend npx -y prettier --check . |