Add spectrum comparison script: implicit vs explicit confounding #32
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| ci: | |
| name: Run tests and handle coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies (including dev) | |
| run: uv sync --dev | |
| - name: Run tests and generate coverage reports | |
| run: | | |
| rm -rf htmlcov coverage.xml | |
| uv run pytest \ | |
| --cov=causalspyne \ | |
| --cov-report=xml:coverage.xml \ | |
| --cov-report=html:htmlcov | |
| - name: Generate coverage badge | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| mkdir -p htmlcov | |
| uv run genbadge coverage -i coverage.xml -o htmlcov/coverage-badge.svg | |
| # coverage.py creates htmlcov/.gitignore with "*", which blocks git from staging new Pages files. | |
| rm -f htmlcov/.gitignore | |
| - name: Deploy production coverage | |
| if: github.ref == 'refs/heads/main' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| folder: htmlcov |