Skip to content

Chore/create project skeleton #2

Chore/create project skeleton

Chore/create project skeleton #2

Workflow file for this run

name: Application unit tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
unit-test-backend:
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
REFRESH_SECRET_KEY: ${{ secrets.REFRESH_SECRET_KEY }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics \
--builtins=screen --per-file-ignore='specs/**/*:E9,F63,F7,F82'
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --show-source --exit-zero --max-complexity=10 \
--max-line-length=96 --statistics --per-file-ignore='specs/**/*:E9,F63,F7,F82'
- name: Run pytest tests
run: |
chmod +x ./targets/backend/scripts/test-coverage.sh
cd targets/backend && ./scripts/test-coverage.sh
unit-test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Test with Jest
run: |
cd targets/frontend
npm ci && npm run test:coverage