Skip to content

Merge dev -> main (#6) #21

Merge dev -> main (#6)

Merge dev -> main (#6) #21

Workflow file for this run

name: Unit & Coverage Tests
on:
# Trigger the workflow when a Pull Request is opened or synchronized targeting the 'main' branch
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
# Specify the self-hosted runner with the appropriate tags
runs-on:
- Linux
- X64
- ChainAlchemy
- Python
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.3'
# Step 3: Install dependencies (from requirements.txt)
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 4: Run tests using pytest
- name: Run tests with coverage
run: |
pip install pytest pytest-cov
pytest --cov --cov-report=xml
# Step 5: Upload coverage report to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true #fail the job if Codecov fails