2021-06-17 22:11:14 +02:00
|
|
|
name: Python Tests
|
|
|
|
|
2021-07-01 17:05:43 +02:00
|
|
|
on:
|
2023-06-26 08:49:37 +02:00
|
|
|
workflow_call:
|
2021-06-17 22:11:14 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-06-26 08:49:37 +02:00
|
|
|
name: Build & test via docker-compose
|
2021-06-17 22:11:14 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-07-01 17:05:43 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: Build the Stack
|
|
|
|
run: docker-compose -f docker-compose-dev.yaml build
|
|
|
|
|
|
|
|
- name: Start containers
|
|
|
|
run: docker-compose -f docker-compose-dev.yaml up -d
|
|
|
|
|
|
|
|
- name: List containers
|
|
|
|
run: docker ps
|
|
|
|
|
|
|
|
- name: Sleep for 60 seconds
|
|
|
|
run: sleep 60s
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Run Django Tests
|
2022-01-31 19:53:57 +01:00
|
|
|
run: docker-compose -f docker-compose-dev.yaml exec --env TESTING=True -T web pytest
|
|
|
|
|
|
|
|
# Run with coverage, saves report on htmlcov dir
|
|
|
|
# run: docker-compose -f docker-compose-dev.yaml exec --env TESTING=True -T web pytest --cov --cov-report=html --cov-config=.coveragerc
|
2021-07-01 17:05:43 +02:00
|
|
|
|
|
|
|
- name: Tear down the Stack
|
2021-08-05 12:25:25 +02:00
|
|
|
run: docker-compose -f docker-compose-dev.yaml down
|