Skip to content

Commit 9d476fd

Browse files
Align CI with bio2zarr/vcztools patterns
Update ci.yml to mirror bio2zarr conventions: weekly cron run, action SHA version comments, fetch-depth: 0 in test job checkout, --locked and --no-default-groups flags throughout, biofuse --help smoke test, and Coveralls coverage upload. Rewrite the packaging job to install the built wheel into a fresh venv and exercise the CLI; drop the unnecessary libfuse3-dev/pkg-config install (biofuse is pure-Python). Add .github/dependabot.yml for monthly github-actions updates, and a new cd.yml that builds sdist+wheel and publishes to PyPI on release and TestPyPI on tag pushes via trusted publishing.
1 parent f8839bf commit 9d476fd

3 files changed

Lines changed: 129 additions & 15 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 5
8+
commit-message:
9+
prefix: ci

‎.github/workflows/cd.yml‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CD
2+
3+
on:
4+
merge_group:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- '*'
10+
release:
11+
types: [published]
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
packaging:
18+
if: github.repository_owner == 'sgkit-dev'
19+
name: Packaging
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
27+
- name: Install uv and set the python version
28+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
29+
with:
30+
python-version: "3.12"
31+
enable-cache: false
32+
33+
- name: Build artefacts
34+
run: uv build
35+
36+
- name: Store the distribution packages
37+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
38+
with:
39+
name: python-package-distributions
40+
path: dist/
41+
42+
publish-to-pypi:
43+
if: github.repository_owner == 'sgkit-dev' && github.event_name == 'release'
44+
needs:
45+
- packaging
46+
runs-on: ubuntu-latest
47+
48+
environment:
49+
name: pypi
50+
url: https://pypi.org/p/biofuse
51+
permissions:
52+
id-token: write # IMPORTANT: mandatory for trusted publishing
53+
54+
steps:
55+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
56+
with:
57+
name: python-package-distributions
58+
path: dist/
59+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
60+
61+
62+
publish-to-testpypi:
63+
if: github.repository_owner == 'sgkit-dev' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
64+
needs:
65+
- packaging
66+
runs-on: ubuntu-latest
67+
68+
environment:
69+
name: testpypi
70+
url: https://test.pypi.org/p/biofuse
71+
72+
permissions:
73+
id-token: write # IMPORTANT: mandatory for trusted publishing
74+
75+
steps:
76+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
77+
with:
78+
name: python-package-distributions
79+
path: dist/
80+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
81+
with:
82+
repository-url: https://test.pypi.org/legacy/

‎.github/workflows/ci.yml‎

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
push:
77
branches:
88
- main
9+
schedule:
10+
# At 04:44 on Monday, see https://crontab.guru/
11+
- cron: "44 4 * * 1"
912

1013
permissions:
1114
contents: read
@@ -15,12 +18,12 @@ jobs:
1518
name: Lint
1619
runs-on: ubuntu-24.04
1720
steps:
18-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1922
with:
2023
persist-credentials: false
2124

2225
- name: Install uv and set the python version
23-
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
26+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2427
with:
2528
python-version: "3.11"
2629

@@ -40,8 +43,9 @@ jobs:
4043
matrix:
4144
python-version: ["3.11", "3.12", "3.13"]
4245
steps:
43-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
46+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4447
with:
48+
fetch-depth: 0
4549
persist-credentials: false
4650

4751
- name: Install system packages
@@ -52,41 +56,60 @@ jobs:
5256
plink1.9 plink2
5357
5458
- name: Install uv
55-
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
59+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
5660
with:
5761
python-version: ${{ matrix.python-version }}
5862

5963
- name: Install dependencies
60-
run: uv sync --group test
64+
run: uv sync --locked --group test --no-default-groups
65+
66+
- name: Test console script entry point
67+
run: |
68+
uv run biofuse --help
6169
6270
- name: Run tests with coverage
6371
run: uv run pytest --cov=biofuse --cov-report=term-missing
6472

73+
- name: Upload coverage to Coveralls
74+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
75+
with:
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
# The first coveralls upload will succeed and others seem to fail now.
78+
# This is a quick workaround for doing a proper "parallel" setup:
79+
# https://github.com/coverallsapp/github-action
80+
fail-on-error: false
81+
6582
packaging:
6683
name: Packaging
67-
runs-on: ubuntu-latest
84+
runs-on: ubuntu-24.04
6885
steps:
69-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
86+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7087
with:
7188
fetch-depth: 0
7289
persist-credentials: false
7390

74-
- name: Install system packages
75-
run: sudo apt-get update && sudo apt-get install -y libfuse3-dev pkg-config
76-
77-
- name: Install uv
78-
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e
91+
- name: Install uv and set the python version
92+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
7993
with:
8094
python-version: "3.12"
8195

8296
- name: Install packaging deps
83-
run: uv sync --group packaging --no-default-groups
97+
run: uv sync --locked --group packaging --no-default-groups
8498

8599
- name: Validate pyproject
86-
run: uv run validate-pyproject pyproject.toml -v
100+
run: uv run --locked --group packaging --no-default-groups validate-pyproject pyproject.toml -v
87101

88102
- name: Build artefacts
89103
run: uv build
90104

91105
- name: Twine check
92-
run: uv run twine check --strict dist/*
106+
run: uv run --locked --group packaging --no-default-groups twine check --strict dist/*
107+
108+
- name: Install into venv
109+
run: |
110+
uv venv cli-test
111+
uv pip install --python=cli-test dist/*.whl
112+
113+
- name: Check biofuse CLI
114+
run: |
115+
./cli-test/bin/biofuse --help

0 commit comments

Comments
 (0)