added CI documentation file #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing Pipeline | |
# Define permissions explicitly | |
permissions: | |
# Only read access needed for most operations | |
contents: read | |
# Needed for test results | |
checks: write | |
# Needed for uploading artifacts | |
actions: read | |
# Needed for codecov | |
pull-requests: write | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
PYTHONPATH: ${{ github.workspace }} | |
COVERAGE_FILE: coverage.xml | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest pytest-cov coverage | |
pip install -e ".[test]" | |
- name: Run tests with coverage | |
run: | | |
coverage run -m pytest | |
coverage xml | |
coverage html | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: | | |
coverage.xml | |
htmlcov/ | |
test-results/ | |
performance-results/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
distributed-tests: | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
PYTHONPATH: ${{ github.workspace }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest pytest-cov | |
pip install -e ".[test]" | |
- name: Run distributed tests | |
run: | | |
python -m pytest tests/distributed/ | |
- name: Upload distributed test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: distributed-test-results | |
path: distributed-test-results/ |