Skip to content

Investigate variational inference for HBR #422

Investigate variational inference for HBR

Investigate variational inference for HBR #422

Workflow file for this run

# This configuration does the following:
# It runs the tests when code is pushed to dev branch and
# when a pull request to dev is created.
# It sets up a Python environment, installs project dependencies, and runs pytest.
# Test results are uploaded as artifacts for later examination.
name: testing
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: | # Install the project dependencies, including pytest-html for generating test reports in the next steps.
pip install -e ".[dev]"
pip install pytest-html
- name: Run Tests with coverage and save report
run: coverage run -m pytest test/ --junitxml=report.xml --html=report.html
- name: Save coverage report
if: always()
run: coverage xml -o coverage.xml
- name: Upload coverage to Codecov
if: always() && matrix.python-version == '3.12' # Only upload coverage from one Python version to avoid duplicate uploads.
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
- name: Upload HTML Report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-report-html-py${{ matrix.python-version }}
path: report.html
- name: Upload XML Report
if: always()
uses: actions/upload-artifact@v4
with:
name: test-report-xml-py${{ matrix.python-version }}
path: report.xml