Add codecov workflow to the testing pipeline. #37
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: Build and Deploy Docs | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[docs] | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
- name: Upload documentation for review | |
if: github.event_name == 'pull_request' | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: vcs2l-docs-pr-${{ github.event.number }} | |
path: docs/build/html | |
retention-days: 7 | |
- name: Upload artifact | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
with: | |
path: docs/build/html | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |