Skip to content

Commit b8459c8

Browse files
authored
Merge pull request #396 from juaml/ci/update-images
[CI]: Upgrade Docker images and workflows
2 parents 2ec35f9 + 9074d01 commit b8459c8

21 files changed

+114
-94
lines changed

.github/workflows/ci-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '.github/workflows/**'
1212
jobs:
1313
run-tests:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
strategy:
1616
fail-fast: false
1717
matrix:

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
run-tests:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
# Use custom docs CI image
1717
container: ghcr.io/juaml/junifer-ci:main
1818
strategy:
@@ -31,16 +31,16 @@ jobs:
3131
run: |
3232
echo "Using FSL : $(flirt -version)"
3333
- name: Install system dependencies
34+
# actions/checkout fails to identify Git as it's not in the CI image
3435
run: |
35-
# actions/checkout fails to identify Git as it's not in the CI image
36-
apt-get -qq update && \
37-
apt-get -qq install -y \
36+
sudo apt-get update
37+
sudo apt-get install -y \
3838
git \
3939
git-annex \
4040
make \
4141
jq
42-
# Copy xfms directory
43-
mkdir -p $HOME/junifer/data/xfms && \
42+
- name: Copy xfms directory
43+
mkdir -p $HOME/junifer/data/xfms
4444
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
4545
- name: Checkout repository
4646
uses: actions/checkout@v4
@@ -59,8 +59,8 @@ jobs:
5959
git config --global user.email "[email protected]"
6060
git config --global user.name "GitHub Runner"
6161
- name: Test with tox
62+
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
6263
run: |
63-
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
6464
git config --system --add safe.directory $(pwd)
6565
tox
6666
- name: Upload coverage to Codecov

.github/workflows/docker-ci-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
jobs:
2727
build:
2828

29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04
3030
permissions:
3131
contents: read
3232
packages: write

.github/workflows/docker-docs-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
jobs:
2727
build:
2828

29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04
3030
permissions:
3131
contents: read
3232
packages: write

.github/workflows/docs-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency: preview-${{ github.ref }}
1717

1818
jobs:
1919
build-docs:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-22.04
2121
# Use custom docs CI image
2222
container: ghcr.io/juaml/junifer-docs:main
2323
steps:

.github/workflows/docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ on:
1212

1313
jobs:
1414
build-docs:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
# Use custom docs CI image
1717
container: ghcr.io/juaml/junifer-docs:main
1818
steps:
1919
- name: Check ANTs
2020
run: |
2121
echo "Using ANTs : $(antsRegistration --version)"
2222
- name: Install system dependencies
23+
# actions/checkout fails to identify Git as it's not in the CI image
2324
run: |
24-
# actions/checkout fails to identify Git as it's not in the CI image
25-
apt-get -qq update && \
26-
apt-get -qq install -y \
25+
sudo apt-get update
26+
sudo apt-get install -y \
2727
git \
2828
git-annex \
2929
make \
3030
jq
31-
# Copy xfms directory
32-
mkdir -p $HOME/junifer/data/xfms && \
31+
- name: Copy xfms directory
32+
mkdir -p $HOME/junifer/data/xfms
3333
cp -ar /root/junifer/data/xfms/. $HOME/junifer/data/xfms/
34-
- name: Checkout source
34+
- name: Checkout repository
3535
uses: actions/checkout@v4
3636
with:
3737
# require all of history to see all tagged versions' docs
@@ -59,8 +59,8 @@ jobs:
5959
path: docs/_build
6060
- name: Build docs
6161
# Use the args we normally pass to sphinx-build, but run sphinx-multiversion
62+
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
6263
run: |
63-
# https://github.com/actions/checkout/issues/1169#issuecomment-2291682583
6464
git config --system --add safe.directory $(pwd)
6565
make -C docs/ html
6666
touch docs/_build/.nojekyll

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build-and-publish:
12+
name: Build and publish
13+
runs-on: ubuntu-latest
14+
permissions:
15+
# Needed for PyPI publishing
16+
id-token: write
17+
# Needed for GitHub releases
18+
contents: write
19+
steps:
20+
- name: Checkout source
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
submodules: true
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.x"
29+
- name: Install build
30+
run:
31+
python -m pip install --upgrade pip
32+
python -m pip install build
33+
- name: Build package
34+
run:
35+
python -m build
36+
- name: Publish package to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
- name: Make release on GitHub
39+
uses: softprops/action-gh-release@v2
40+
if: startsWith(github.ref, 'refs/tags/')
41+
with:
42+
files: |
43+
dist/*.tar.gz
44+
dist/*.whl
45+
generate_release_notes: true
46+
make_latest: true

.github/workflows/pypi.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.6.0
7+
rev: v5.0.0
88
hooks:
99
- id: check-ast
1010
- id: check-docstring-first
@@ -17,24 +17,24 @@ repos:
1717
- id: trailing-whitespace
1818
args: [--markdown-linebreak-ext=md]
1919
- repo: https://github.com/abravalheri/validate-pyproject
20-
rev: v0.16
20+
rev: v0.23
2121
hooks:
2222
- id: validate-pyproject
2323
- repo: https://github.com/psf/black-pre-commit-mirror
24-
rev: 24.4.2
24+
rev: 24.10.0
2525
hooks:
2626
- id: black
2727
exclude: ^(docs/|examples/|tools/)
2828
args: [--check]
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.4.2
30+
rev: v0.9.3
3131
hooks:
3232
- id: ruff
3333
types_or: [python, jupyter]
3434
exclude: ^(__init__.py)
3535
args: [--output-format, grouped, --show-fixes]
3636
- repo: https://github.com/codespell-project/codespell
37-
rev: v2.2.6
37+
rev: v2.4.0
3838
hooks:
3939
- id: codespell
4040
exclude: ^(.github/|docs/)
@@ -48,7 +48,7 @@ repos:
4848
- id: rst-directive-colons
4949
- id: rst-inline-touching-normal
5050
- repo: https://github.com/adamchainz/blacken-docs
51-
rev: "1.16.0"
51+
rev: "1.19.1"
5252
hooks:
5353
- id: blacken-docs
5454
additional_dependencies:

Dockerfile-ci

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ RUN apt-get update && \
4141
file \
4242
dc \
4343
libquadmath0 \
44-
libgomp1
44+
libgomp1 \
45+
&& rm -rf /var/lib/apt/lists/*
4546

4647
# Add xfms
4748
COPY --from=ghcr.io/juaml/human-template-xfms:main /opt/xfms /root/junifer/data/xfms

0 commit comments

Comments
 (0)