Skip to content

Mypy errors fix

Mypy errors fix #1087

Workflow file for this run

name: Backend Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10", "3.11", "3.12" ]
django-version: [ 4, 5 ]
runs-on: ${{ matrix.os }}
env:
DOCKER_COMPOSE_PATH: ./infrastructure/backend/docker-compose.ci.yml
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install and configure poetry
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.0
virtualenvs-create: false
virtualenvs-in-project: false
installer-parallel: true
#----------------------------------------------
# copy docker compose file
#----------------------------------------------
- name: Copy docker compose file
run: |
cp $GITHUB_WORKSPACE/$DOCKER_COMPOSE_PATH ./docker-compose.yml
#----------------------------------------------
# build Frontend files
#----------------------------------------------
- name: Install dependencies and build frontend
run: |
npm ci
npm run tailwind-build
npm run webpack-build
if [ -f frontend/static/src/output.css ]; then
echo "output.css is created"
else
echo "output.css is not created"
exit 1
fi
if [ -d frontend/static/js/c/ ]; then
echo "webpack has been built"
else
echo "frontend/static/js/c/ was not created from webpack build"
exit 1
fi
if [ -f webpack-stats.json ]; then
echo "webpack has built webpack-stats to work with chunks"
else
echo "webpack-stats was not built so cannot work with chunks"
exit 1
fi
#----------------------------------------------
# run docker compose & tests
#----------------------------------------------
- name: Build and run docker-compose.ci.yml
run: |
export TESTING=true
docker compose up -d --wait --wait-timeout 30
- name: Run the test scripts
run: |
export TESTING=true
docker compose exec -T myfinances_django ./infrastructure/backend/scripts/tests/views.sh