Skip to content

[frontend] Format code with prettier #753

[frontend] Format code with prettier

[frontend] Format code with prettier #753

Workflow file for this run

name: Test the application
on: [pull_request]
jobs:
lint-frontend:
name: Lint Frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package.json
- name: Frontend lint
run: |
npm install
npm run lint
lint-backend:
name: Lint Backend
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: backend/package.json
- name: Backend lint
run: |
yarn
yarn run lint
format-check:
name: Code Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Format check
run: npx -y prettier --check frontend backend
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 "BACKEND_JWT_SECRET=${{ vars.BACKEND_JWT_SECRET }}" >> .env
echo "POSTGRES_USER=${{ vars.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ vars.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_DB=${{ vars.POSTGRES_DB }}" >> .env
echo "JWT_PUBLIC_KEY=\"${{ secrets.JWT_PUBLIC_KEY }}\"" >> .env
echo "JWT_PRIVATE_KEY=\"${{ secrets.JWT_PRIVATE_KEY }}\"" >> .env
echo "PUBLIC_WEB_URL=${{ vars.PUBLIC_WEB_URL }}" >> .env
- name: Build images
run: docker compose build
- name: Build frontend
run: docker compose run --rm frontend npm run build && docker compose down
- 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