CI workflow (benedekrozemberczki/pytorch_geometric_temporal)
The CI workflow from benedekrozemberczki/pytorch_geometric_temporal, explained and optimized by Latchkey.
CI health: F - at risk
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the CI workflow from the benedekrozemberczki/pytorch_geometric_temporal repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: s-weigand/setup-conda@v1
with:
activate-conda: true
python-version: 3.8
- run: conda --version
- run: which python
- name: Install main dependencies
run: |
python -m pip install torch==2.3.0 torchvision torchaudio -f https://download.pytorch.org/whl/cpu/torch_stable.html
python -m pip install torch-geometric
python -m pip install sphinx sphinx_rtd_theme
- name: Install main package
run: |
python -m pip install -e .[test]
- name: Run test-suite
run: |
python -m pytest
- name: Generate coverage report
if: success()
run: |
pip install coverage
coverage run -m pytest
coverage xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
if: success()
with:
file: coverage.xml
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: CI on: push: branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-22.04] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: cache: 'pip' python-version: 3.8 - uses: s-weigand/setup-conda@v1 with: activate-conda: true python-version: 3.8 - run: conda --version - run: which python - name: Install main dependencies run: | python -m pip install torch==2.3.0 torchvision torchaudio -f https://download.pytorch.org/whl/cpu/torch_stable.html python -m pip install torch-geometric python -m pip install sphinx sphinx_rtd_theme - name: Install main package run: | python -m pip install -e .[test] - name: Run test-suite run: | python -m pytest - name: Generate coverage report if: success() run: | pip install coverage coverage run -m pytest coverage xml - name: Upload coverage report to codecov uses: codecov/codecov-action@v1 if: success() with: file: coverage.xml
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.