Skip to content

Commit

Permalink
Merge branch 'develop' into topic/chriscummings/issue-72/bump-django
Browse files Browse the repository at this point in the history
  • Loading branch information
crankynetman authored Nov 14, 2024
2 parents 6c66554 + de3d2b5 commit e650af6
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 77 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build sphinx docs

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches:
- '**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -48,5 +48,7 @@ jobs:
path: 'docs/_build/html'

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4

33 changes: 33 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run flake8

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

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

jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Docker images.
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}-${{ hashFiles('docker-compose.yaml') }}

- name: Install dependencies
run: |
pip install flake8
- name: Run flake8
run: |
flake8
79 changes: 79 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Run pytest

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

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

jobs:
pytest:
name: Run Pytest
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: scram
POSTGRES_PASSWORD: ''
POSTGRES_DB: test_scram
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U scram"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out the code
uses: actions/checkout@v4

- 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: Build Docker images
run: make build

- name: Migrate Database
run: make migrate

- name: Run Application
run: make run

- name: Run Pytest with Coverage
env:
POSTGRES_USER: scram
POSTGRES_DB: test_scram
run: make coverage.xml

- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml

- name: Display Coverage Metrics
uses: 5monkeys/cobertura-action@v14
with:
minimum_coverage: '50'

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

- name: Clean Up
if: always()
run: make clean
68 changes: 0 additions & 68 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ python_files = [

# ==== Coverage ====
[tool.coverage.run]
omit = ["*/migrations/*", "*/tests/*"]
include = ["scram/*", "config/*", "translator/*"]
omit = ["**/migrations/*", "scram/contrib/*", "*/tests/*"]
plugins = ["django_coverage_plugin"]



# ==== black ====
[tool.black]
line-length = 119
Expand Down
6 changes: 0 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ django_settings_module = config.settings.test
# Django migrations should not produce any errors:
ignore_errors = True

[coverage:run]
include = scram/*
omit = *migrations*, *tests*
plugins =
django_coverage_plugin

[behave]
paths = scram/route_manager/tests/acceptance
stderr_capture = no

0 comments on commit e650af6

Please sign in to comment.