Skip to content
This repository was archived by the owner on Jan 3, 2025. It is now read-only.

Commit 1f7022d

Browse files
committed
👷 Enhance CI workflow with manylinux container
1 parent 33783ea commit 1f7022d

File tree

1 file changed

+44
-27
lines changed

1 file changed

+44
-27
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ on:
99

1010
jobs:
1111
build-opencv:
12-
name: Build OpenCV
12+
name: Build OpenCV (${{ matrix.os.artifact-name || matrix.os.runner }})
1313

1414
strategy:
1515
matrix:
1616
os:
17-
- ubuntu-latest
18-
- windows-latest
19-
- macos-13
20-
- macos-latest
17+
- runner: ubuntu-latest
18+
container: quay.io/pypa/manylinux_2_34_x86_64
19+
artifact-name: linux
20+
- runner: ubuntu-latest
21+
container: quay.io/pypa/musllinux_1_2_x86_64
22+
artifact-name: linux-musl
23+
- runner: windows-latest
24+
- runner: macos-13
25+
- runner: macos-latest
2126

2227
defaults:
2328
run:
@@ -26,16 +31,16 @@ jobs:
2631
env:
2732
SCCACHE_GHA_ENABLED: true
2833

29-
runs-on: ${{ matrix.os }}
34+
runs-on: ${{ matrix.os.runner }}
35+
container: ${{ matrix.os.container }}
3036

3137
steps:
3238
- name: Get latest release
3339
id: latest-release
3440
run: |
35-
curl -s https://api.github.com/repos/opencv/opencv/releases/latest \
36-
-H "Accept: application/vnd.github.v3+json" \
37-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
38-
| jq -r '.tag_name' | tee latest-release.txt
41+
curl -Ls -o /dev/null -w %{url_effective} \
42+
https://github.com/opencv/opencv/releases/latest \
43+
| sed 's#.*tag/\(.*\)$#\1#' > latest-release.txt
3944
echo "tag=$(cat latest-release.txt)" >> $GITHUB_OUTPUT
4045
4146
- uses: actions/checkout@main
@@ -85,20 +90,25 @@ jobs:
8590
8691
- uses: actions/upload-artifact@main
8792
with:
88-
name: opencv-${{ matrix.os }}
93+
name: opencv-${{ matrix.os.artifact-name || matrix.os.runner }}
8994
path: ./opencv
9095

9196
build:
92-
name: Build Wheel
97+
name: Build Wheel (${{ matrix.os.artifact-name || matrix.os.runner }})
9398
needs: [build-opencv]
9499

95100
strategy:
96101
matrix:
97102
os:
98-
- ubuntu-latest
99-
- windows-latest
100-
- macos-13
101-
- macos-latest
103+
- runner: ubuntu-latest
104+
container: quay.io/pypa/manylinux_2_34_x86_64
105+
artifact-name: linux
106+
- runner: ubuntu-latest
107+
container: quay.io/pypa/musllinux_1_2_x86_64
108+
artifact-name: linux-musl
109+
- runner: windows-latest
110+
- runner: macos-13
111+
- runner: macos-latest
102112
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
103113
exclude:
104114
- os: macos-latest
@@ -111,14 +121,15 @@ jobs:
111121
run:
112122
shell: bash
113123

114-
runs-on: ${{ matrix.os }}
124+
runs-on: ${{ matrix.os.runner }}
125+
container: ${{ matrix.os.container }}
115126

116127
steps:
117128
- uses: actions/checkout@main
118129

119130
- uses: actions/download-artifact@main
120131
with:
121-
name: opencv-${{ matrix.os }}
132+
name: opencv-${{ matrix.os.artifact-name || matrix.os.runner }}
122133
path: ./opencv
123134

124135
- uses: pdm-project/setup-pdm@main
@@ -151,20 +162,25 @@ jobs:
151162

152163
- uses: actions/upload-artifact@main
153164
with:
154-
name: wheel-${{matrix.os}}-${{matrix.python}}
165+
name: wheel-${{ matrix.os.artifact-name || matrix.os.runner }}-${{ matrix.python }}
155166
path: ./dist/*.whl
156167

157168
test:
158-
name: Test Wheel
169+
name: Test Wheel (${{ matrix.os.artifact-name || matrix.os.runner }})
159170
needs: [build]
160171

161172
strategy:
162173
matrix:
163174
os:
164-
- ubuntu-latest
165-
- windows-latest
166-
- macos-13
167-
- macos-latest
175+
- runner: ubuntu-latest
176+
container: quay.io/pypa/manylinux_2_34_x86_64
177+
artifact-name: linux
178+
- runner: ubuntu-latest
179+
container: quay.io/pypa/musllinux_1_2_x86_64
180+
artifact-name: linux-musl
181+
- runner: windows-latest
182+
- runner: macos-13
183+
- runner: macos-latest
168184
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
169185
exclude:
170186
- os: macos-latest
@@ -177,15 +193,16 @@ jobs:
177193
run:
178194
shell: bash
179195

180-
runs-on: ${{ matrix.os }}
196+
runs-on: ${{ matrix.os.runner }}
197+
container: ${{ matrix.os.container }}
181198

182199
steps:
183200
- uses: actions/checkout@main
184201

185202
- name: Download wheel
186203
uses: actions/download-artifact@main
187204
with:
188-
name: wheel-${{matrix.os}}-${{matrix.python}}
205+
name: wheel-${{ matrix.os.artifact-name || matrix.os.runner }}-${{ matrix.python }}
189206
path: ./dist
190207

191208
- uses: pdm-project/setup-pdm@main
@@ -196,7 +213,7 @@ jobs:
196213
- name: Install dependencies
197214
run: |
198215
pdm install -G test --no-self
199-
pdm add dist/*.whl --no-lock
216+
pdm add -v dist/*.whl --frozen-lockfile
200217
201218
- name: Run tests
202219
run: |

0 commit comments

Comments
 (0)