Skip to content

Commit 5ddc13f

Browse files
authored
ci: schedule compatibility checks against latest snakemake release (#14)
* ci: re-run tests when a new snakemake release ships `uv.lock` pins snakemake to an exact version, so the regular CI never exercises the project against newer upstream releases. Add a dedicated compatibility workflow that: - polls the snakemake GitHub releases endpoint on a 6-hour cron, - gates the actual test job through `actions/cache` keyed on the upstream tag, so the matrix only runs when a tag we have not seen before appears, - supports manual `workflow_dispatch` and external `repository_dispatch` (event type `snakemake-release`) so a bot or human can force a run regardless of the cache state, - refreshes `uv.lock` with `uv lock --upgrade-package snakemake` and runs the existing tox matrix on Python 3.11 and 3.14. A failure indicates an upstream regression (or a constraint that needs loosening) and shows up as a normal red Actions run; no automatic issue filing is added yet. * ci: key compat cache on uv-resolved snakemake version Replace the GitHub releases poll with `uv lock --upgrade-package snakemake` and use the resolved version from `uv.lock` as the actions/cache key. The signal we actually care about is whether `uv` would resolve a snakemake version we have not tested yet, which covers PyPI-only releases, honors the `>=9,<10` constraint automatically, and avoids the GitHub API call entirely.
1 parent 41afc05 commit 5ddc13f

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Snakemake compatibility
2+
3+
# Re-runs the test suite against the latest snakemake release that
4+
# satisfies our version constraint. The detect job asks `uv` itself
5+
# what would be resolved if `uv.lock` were upgraded for snakemake; the
6+
# resolved version is used as the actions/cache key, so the matrix
7+
# only runs when the upgrade would land on a snakemake version we have
8+
# not tested before.
9+
#
10+
# Trigger paths:
11+
# - schedule: backstop poll every 6h
12+
# - workflow_dispatch: manual run
13+
# - repository_dispatch (snakemake-release): external bot can ping us
14+
# directly so we don't have to wait for the next cron tick
15+
16+
on:
17+
schedule:
18+
- cron: "17 */6 * * *"
19+
workflow_dispatch:
20+
repository_dispatch:
21+
types: [snakemake-release]
22+
23+
env:
24+
UV_VERSION: "0.11.6"
25+
UV_PYTHON_PREFERENCE: "managed"
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
detect:
32+
name: Resolve latest snakemake
33+
runs-on: ubuntu-latest
34+
outputs:
35+
version: ${{ steps.resolve.outputs.version }}
36+
changed: ${{ steps.cache.outputs.cache-hit != 'true' }}
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v6
43+
with:
44+
version: ${{ env.UV_VERSION }}
45+
enable-cache: true
46+
47+
- name: Resolve latest snakemake under current constraint
48+
id: resolve
49+
run: |
50+
uv lock --upgrade-package snakemake
51+
version=$(python3 -c 'import tomllib; d=tomllib.load(open("uv.lock","rb")); print(next(p["version"] for p in d["package"] if p["name"]=="snakemake"))')
52+
echo "version=$version" >> "$GITHUB_OUTPUT"
53+
echo "Resolved snakemake==$version"
54+
55+
- name: Check whether this resolved version has already been tested
56+
uses: actions/cache@v4
57+
id: cache
58+
with:
59+
path: .snakemake-compat-marker
60+
key: snakemake-compat-${{ steps.resolve.outputs.version }}
61+
62+
- name: Record marker for new version
63+
if: steps.cache.outputs.cache-hit != 'true'
64+
run: echo "${{ steps.resolve.outputs.version }}" > .snakemake-compat-marker
65+
66+
compat:
67+
name: Test against snakemake ${{ needs.detect.outputs.version }} (Python ${{ matrix.python-version }})
68+
needs: detect
69+
if: |
70+
needs.detect.outputs.changed == 'true'
71+
|| github.event_name == 'workflow_dispatch'
72+
|| github.event_name == 'repository_dispatch'
73+
runs-on: ubuntu-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
python-version: ["3.11", "3.14"]
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@v4
81+
82+
- name: Install uv
83+
uses: astral-sh/setup-uv@v6
84+
with:
85+
version: ${{ env.UV_VERSION }}
86+
enable-cache: true
87+
88+
- name: Set up Python ${{ matrix.python-version }}
89+
run: uv python install ${{ matrix.python-version }}
90+
91+
- name: Upgrade snakemake in uv.lock
92+
run: uv lock --upgrade-package snakemake
93+
94+
- name: Install project dependencies
95+
run: uv sync --all-groups
96+
97+
- name: Run tests
98+
run: uv run tox -e py${{ matrix.python-version }}

0 commit comments

Comments
 (0)