Skip to content

Commit 426ab6a

Browse files
committed
Check for prereleases to test and matrix on Python versions.
1 parent ec5b91e commit 426ab6a

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

.github/workflows/test_docs.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,79 @@ on:
99
- main
1010

1111
jobs:
12-
test_docs:
13-
name: Test docs
12+
test_release:
13+
name: Test docs on latest release
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
1717
os:
1818
- ubuntu-latest
1919
- macos-latest
2020
- windows-latest
21+
python:
22+
- "3.10"
23+
- "3.11"
24+
- "3.12"
25+
2126
steps:
2227
- name: Checkout repository
2328
uses: actions/checkout@v3
2429

2530
- name: Set up Python
2631
uses: actions/setup-python@v4
2732
with:
28-
python-version: "3.10"
33+
python-version: ${{ matrix.python }}
34+
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip acquire-imaging
38+
pip install -r tests/requirements-test.txt
39+
40+
- name: Test docs
41+
run: |
42+
python -m pytest -k test_tutorials --tb=short -s --color=yes --maxfail=5 --log-cli-level=0
43+
44+
test_prerelease:
45+
name: Test docs on latest prerelease
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
matrix:
49+
os:
50+
- ubuntu-latest
51+
- macos-latest
52+
- windows-latest
53+
python:
54+
- "3.10"
55+
- "3.11"
56+
- "3.12"
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v3
61+
62+
- name: Set up Python
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: ${{ matrix.python }}
66+
67+
- name: Check for a pre-release
68+
run: |
69+
export VER=$(curl -s https://pypi.org/rss/project/acquire-imaging/releases.xml | sed -n 's/\s*<title>\([^<]*\).*/ \1/p' | paste -sd, ; | cut -d, -f2)
70+
if [[ $VER == *"rc"* ]]; then
71+
echo "PRELEASE=1" >> $GITHUB_ENV
72+
echo "PRELEASE_VERSION=$VER" >> $GITHUB_ENV
73+
else
74+
echo "PRELEASE=0" >> $GITHUB_ENV
75+
fi
76+
shell: bash
2977

3078
- name: Install dependencies
79+
if: env.PRELEASE == 1
3180
run: |
32-
python -m pip install --upgrade pip
81+
python -m pip install --upgrade pip acquire-imaging==$PRELEASE_VERSION
3382
pip install -r tests/requirements-test.txt
3483
3584
- name: Test docs
85+
if: env.PRELEASE == 1
3686
run: |
3787
python -m pytest -k test_tutorials --tb=short -s --color=yes --maxfail=5 --log-cli-level=0

tests/requirements-test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
acquire-imaging==0.4.0rc1
21
napari[all]
32
numpy
43
ome-zarr

0 commit comments

Comments
 (0)