Skip to content

Add code format check and linter check to CI #82

Add code format check and linter check to CI

Add code format check and linter check to CI #82

Workflow file for this run

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 Code Format Check (Frontend)
run: (docker compose logs -f &) && docker compose run frontend npx -y prettier --check .
- 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 . && docker compose down
- name: Run Code Format Check (Frontend)
run: (docker compose logs -f &) && docker compose run frontend npx -y prettier --check .