Update gh workflows to update "latest" and avoid docs pull clash #285
Workflow file for this run
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: Push Workflow | |
on: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Document branch | |
run: echo ${{ github.ref_name }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Configure Git user | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[tests] | |
- name: Run Ruff | |
run: ruff check --output-format=github network_wrangler | |
- name: Run tests with coverage and benchmarking | |
run: | | |
pytest --junitxml=coverage.xml --benchmark-save=benchmark --benchmark-json=benchmark.json | |
- name: Build docs | |
run: | | |
mike deploy --push ${{ github.ref_name }} | |
- name: Update latest alias if on main branch | |
if: github.ref == 'refs/heads/main' | |
run: | | |
mike alias latest ${{ github.ref_name }} --push | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: 'pytest' | |
output-file-path: benchmark.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true | |
summary-always: true | |
- name: Pytest coverage comment | |
if: github.event_name == 'pull_request' | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
junitxml-path: ./coverage.xml | |
- name: Upload coverage and benchmark artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-and-benchmark | |
path: | | |
coverage.xml | |
benchmark.json |