9
9
- main
10
10
11
11
jobs :
12
- test_docs :
13
- name : Test docs
12
+ test_release :
13
+ name : Test docs on latest release
14
14
runs-on : ${{ matrix.os }}
15
15
strategy :
16
16
matrix :
17
17
os :
18
18
- ubuntu-latest
19
19
- macos-latest
20
20
- windows-latest
21
+ python :
22
+ - " 3.10"
23
+ - " 3.11"
24
+ - " 3.12"
25
+
21
26
steps :
22
27
- name : Checkout repository
23
28
uses : actions/checkout@v3
24
29
25
30
- name : Set up Python
26
31
uses : actions/setup-python@v4
27
32
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
29
77
30
78
- name : Install dependencies
79
+ if : env.PRELEASE == 1
31
80
run : |
32
- python -m pip install --upgrade pip
81
+ python -m pip install --upgrade pip acquire-imaging==$PRELEASE_VERSION
33
82
pip install -r tests/requirements-test.txt
34
83
35
84
- name : Test docs
85
+ if : env.PRELEASE == 1
36
86
run : |
37
87
python -m pytest -k test_tutorials --tb=short -s --color=yes --maxfail=5 --log-cli-level=0
0 commit comments