.github/workflows/test_coverage.yml #159
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: Coverage | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: '*' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 */3 * *' # Runs at midnight every 3 days | |
env: | |
RPC_URL: ${{ secrets.RPC_URL }} | |
LICENSE_KEY: ${{ secrets.LICENSE_KEY }} | |
CHAIN: ethereum | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
jobs: | |
check-test-coverage: | |
# Skip CI if [ci skip] in the commit message | |
if: (github.event_name != 'schedule') || github.ref == 'refs/heads/main' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'macos-14'] | |
python-version: ['3.10', '3.11', '3.12'] | |
# concurrency: single | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup dev environment | |
uses: CompassLabs/workflows/.github/actions/setup_dojo_pypi@main | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run tests | |
run: | | |
pip install pytest pytest-cov | |
pytest --durations=0 --cov=policies --cov=agents --cov-report xml tests/ | |
env: | |
COVERAGE_FILE: .coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: CompassLabs/dojo_examples |