Skip to content

Created outline for readme - set up for deployment and handover guide #148

Created outline for readme - set up for deployment and handover guide

Created outline for readme - set up for deployment and handover guide #148

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# - name: Format with Black
# run: |
# pip install black
# black --check --diff backend #--check to only check formatting without making changes
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8 backend \--max-line-length=88\--extend-ignore=E203,W503
- name: Run tests with pytest
run: |
pip install pytest pytest-cov
PYTHONPATH=$PYTHONPATH:$(pwd) pytest \
--cov=backend \
--cov-report=xml:coverage-unit.xml \
--cov-report=html:htmlcov-unit \
--cov-report=term \
--junitxml=junit-unit.xml \
-m unit \
backend/tests/ \
--disable-warnings \
-v
continue-on-error: true
- name: Run integration tests with pytest
run: |
PYTHONPATH=$PYTHONPATH:$(pwd) pytest \
--cov=backend \
--cov-append \
--cov-report=xml:coverage-integration.xml \
--cov-report=html:htmlcov-integration \
--cov-report=term \
--junitxml=junit-integration.xml \
-m integration \
backend/tests/ \
--disable-warnings \
-v
continue-on-error: true
- name: Generate combined coverage report
run: |
pip install coverage
# Generate combined coverage from .coverage file (both test runs appended)
coverage xml -o coverage.xml
coverage html -d htmlcov
- name: Upload unit test coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-unit-report
path: htmlcov-unit/
retention-days: 30
- name: Upload integration test coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-integration-report
path: htmlcov-integration/
retention-days: 30
- name: Upload combined coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-combined-report
path: htmlcov/
retention-days: 30
- name: Upload coverage XML
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-xml
path: coverage.xml
retention-days: 30
- name: Upload unit test JUnit XML
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-unit-xml
path: junit-unit.xml
retention-days: 30
- name: Upload integration test JUnit XML
uses: actions/upload-artifact@v4
if: always()
with:
name: junit-integration-xml
path: junit-integration.xml
retention-days: 30