Improved schedules #923
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: 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@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# install and configure poetry | |
#---------------------------------------------- | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.5.1 | |
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 [ -f frontend/static/js/bundle.js ] && [ -f frontend/static/js/bundle.js.map ]; then | |
echo "bundle.js and bundle.js.map are created" | |
else | |
echo "bundle.js and/or bundle.js.map are not created" | |
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 |