Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions .github/workflows/behave_next_python.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/coverage-finish.yml

This file was deleted.

86 changes: 46 additions & 40 deletions .github/workflows/behave.yml → .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
---
name: Run behave
name: Run Django Tests

on:
push:
branches:
- "**"
- main
pull_request:
branches:
- main
- develop
- '**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this concurrency is a bit fuzzy to me. my best guess is that we run all the workflow file for a specific PR concurrently. so for example this whole django workflow would run concurrently for a given PR and cancel any other jobs if one fails?

cancel-in-progress: true

permissions:
contents: read
pull-requests: write
checks: write
jobs:
behave:
name: Run Behave
django:
name: Run Django Tests
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.11", "3.12"]

steps:
- name: Check out the code
Expand All @@ -29,76 +32,79 @@ jobs:
- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose make

- name: Check Docker state (pre-build)
run: docker ps

- name: Login to Docker Hub
if: ${{ !env.ACT }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_PULL_AUTH_USER }}
password: ${{ secrets.DOCKER_HUB_PULL_AUTH_PAT }}

- name: Check Docker state (pre-build)
run: docker ps

- name: Build Docker images
run: make build
env:
PYTHON_IMAGE_VER: "${{ matrix.python-version }}"

- name: Check for missing migrations
run: docker compose run --rm django python manage.py makemigrations --check

- name: Migrate Database
run: make migrate
run: docker compose run --rm django python manage.py migrate --fake-initial --noinput -v 2

- name: Run Application
run: make run

- name: Check Docker state (pre-test)
run: docker ps

- name: Run pytest + behave with Coverage
- name: Run Django Pytest
env:
POSTGRES_USER: scram
POSTGRES_DB: test_scram
run: make pytest-django

- name: Run Django Behave (Acceptance Tests)
env:
POSTGRES_USER: scram
POSTGRES_DB: test_scram
run: make behave-django

- name: Run Django Integration Tests
env:
POSTGRES_USER: scram
POSTGRES_DB: test_scram
run: make coverage.xml
run: make integration-django

- name: Generate Coverage Report
run: |
docker compose run --rm -w /app django coverage report
docker compose run --rm -w /app django coverage xml

- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2

- name: Upload Coverage to Coveralls
if: matrix.python-version == '3.12'
if: ${{ !env.ACT }}
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: behave
fail-on-error: false
fail-on-error: false

- name: Upload Coverage to GitHub
if: matrix.python-version == '3.12'
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: django/coverage.xml

- name: Display Coverage Metrics
if: matrix.python-version == '3.12'
if: ${{ !env.ACT }}
uses: 5monkeys/cobertura-action@v14
with:
minimum_coverage: "50"
report_name: "Django Pytest/Behave Coverage"
minimum_coverage: "70"
report_name: "Django Coverage"
path: django/coverage.xml


- name: Check Docker state (post-test)
if: always()
run: docker ps

- name: Stop Services
if: always()
run: make stop

- name: Clean Up
if: always()
run: make clean
110 changes: 0 additions & 110 deletions .github/workflows/pytest.yml

This file was deleted.

Loading
Loading