Code refactored #694
Workflow file for this run
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: true | |
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 | |
#---------------------------------------------- | |
# install docker compose | |
# setup + configure docker compose | |
#---------------------------------------------- | |
- name: Install Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
#---------------------------------------------- | |
# copy docker compose file | |
#---------------------------------------------- | |
- name: Copy docker compose file | |
run: | | |
cp $GITHUB_WORKSPACE/$DOCKER_COMPOSE_PATH ./docker-compose.yml | |
#---------------------------------------------- | |
# 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 |