Skip to content

Commit 98c0d04

Browse files
committed
Add separate verify build action
1 parent ee40c95 commit 98c0d04

File tree

3 files changed

+252
-24
lines changed

3 files changed

+252
-24
lines changed

.github/workflows/build-native-action.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
target: aarch64
3131

3232
name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}"
33-
3433
runs-on:
3534
- ${{ (contains(matrix.host, 'x86_64') && 'ubuntu-24.04') || 'ubuntu-24.04-arm' }}
3635

@@ -61,11 +60,6 @@ jobs:
6160
run: |
6261
venv/bin/python3 -m relenv build --no-pretty --arch=${{ matrix.target }} --python=${{ matrix.version }}
6362
64-
- name: Verify Build
65-
if: ${{ matrix.host == matrix.target }}
66-
run: |
67-
venv/bin/python3 -m nox -e tests -- -s tests/test_verify_build.py
68-
6963
- name: Linux Logs
7064
uses: actions/upload-artifact@v4
7165
if: always()
@@ -126,14 +120,6 @@ jobs:
126120
run: |
127121
python3 -m relenv build --no-pretty --python=${{ matrix.version }}
128122
129-
- name: Unpatch /usr/local
130-
run: |
131-
sudo mv -f /tmp/local/* /usr/local/
132-
133-
- name: Verify Build
134-
run: |
135-
python3 -m nox -e tests -- tests/test_verify_build.py
136-
137123
- name: MacOS Logs
138124
uses: actions/upload-artifact@v4
139125
if: always()
@@ -142,7 +128,7 @@ jobs:
142128
path: logs/*
143129
retention-days: 5
144130

145-
- name: Python build
131+
- name: "Upload artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz"
146132
uses: actions/upload-artifact@v4
147133
with:
148134
name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz
@@ -193,10 +179,6 @@ jobs:
193179
run: |
194180
python3 -m relenv build --no-pretty --python=${{ matrix.version }}
195181
196-
- name: Verify Build
197-
run: |
198-
nox -e tests -- tests/test_verify_build.py
199-
200182
- name: MacOS Logs
201183
uses: actions/upload-artifact@v4
202184
if: always()
@@ -260,11 +242,6 @@ jobs:
260242
run: |
261243
python -m relenv build --no-pretty --arch=${{ matrix.arch }} --python=${{ matrix.version }}
262244
263-
- name: Verify Build
264-
if: ${{ matrix.arch == 'amd64' }}
265-
run: |
266-
nox -e tests -- tests/test_verify_build.py
267-
268245
- name: Upload Build Logs
269246
uses: actions/upload-artifact@v4
270247
if: always()

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,20 @@ jobs:
8181
with:
8282
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
8383

84+
verify-native:
85+
name: Verify Builds
86+
uses: ./.github/workflows/verify-build-action.yml
87+
needs:
88+
- build-native
89+
- get-changed-files
90+
with:
91+
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
92+
8493
test-fips:
8594
name: Test Fips Mode
8695
needs:
8796
- build-native
97+
- verify-native
8898
- get-changed-files
8999
uses: ./.github/workflows/test-fips-action.yml
90100

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
name: Verify Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
changed-files:
7+
required: true
8+
type: string
9+
description: Build relenv python builds
10+
11+
jobs:
12+
13+
build_linux:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
version:
18+
- 3.10.18
19+
- 3.11.13
20+
- 3.12.11
21+
- 3.13.5
22+
host:
23+
- x86_64
24+
- aarch64
25+
include:
26+
- host: x86_64
27+
target: x86_64
28+
- host: aarch64
29+
target: aarch64
30+
31+
name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}"
32+
runs-on:
33+
- ${{ (contains(matrix.host, 'x86_64') && 'ubuntu-24.04') || 'ubuntu-24.04-arm' }}
34+
35+
env:
36+
RELENV_DATA: ${{ github.workspace }}
37+
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Set up Python 3.10
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: '3.10'
45+
46+
- name: Install Dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y build-essential bison python3-all patchelf swig cmake libldap2-dev libsasl2-dev ldap-utils libssl-dev pkg-config libvirt-dev default-libmysqlclient-dev python3-virtualenv
50+
virtualenv venv
51+
venv/bin/python3 -m pip install nox ppbt
52+
53+
- name: Python Version
54+
run: |
55+
venv/bin/python3 --version
56+
venv/bin/python3 -c 'import os; print(os.name)'
57+
58+
- name: "Download artifact: build/${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz"
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: ${{ matrix.version }}-${{ matrix.target }}-linux-gnu.tar.xz
62+
path: build/
63+
64+
- name: Verify Build
65+
if: ${{ matrix.host == matrix.target }}
66+
run: |
67+
venv/bin/python3 -m nox -e tests -- -s tests/test_verify_build.py
68+
69+
- name: Linux Logs
70+
uses: actions/upload-artifact@v4
71+
if: always()
72+
with:
73+
name: ${{ matrix.version }}-${{ matrix.host }}-${{ matrix.target }}-linux-gnu-logs
74+
path: logs/*
75+
retention-days: 5
76+
77+
test_macos_13_x86_64:
78+
name: "Python macOS"
79+
80+
runs-on: macos-13
81+
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
version:
86+
- 3.10.18
87+
- 3.11.13
88+
- 3.12.11
89+
- 3.13.5
90+
arch:
91+
- x86_64
92+
93+
env:
94+
RELENV_DATA: ${{ github.workspace }}
95+
96+
steps:
97+
- uses: actions/checkout@v3
98+
99+
- name: Set up Python 3.11
100+
uses: actions/setup-python@v5
101+
with:
102+
python-version: '3.11'
103+
104+
- name: Show environment
105+
run: |
106+
env
107+
108+
- name: Install nox
109+
run: |
110+
pip3 install nox
111+
112+
- name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz"
113+
uses: actions/download-artifact@v4
114+
with:
115+
name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz
116+
path: build/
117+
118+
- name: Verify Build
119+
run: |
120+
python3 -m nox -e tests -- tests/test_verify_build.py
121+
122+
- name: MacOS Logs
123+
uses: actions/upload-artifact@v4
124+
if: always()
125+
with:
126+
name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs
127+
path: logs/*
128+
retention-days: 5
129+
130+
test_macos_13_arm64:
131+
name: "Python macOS"
132+
133+
runs-on: macos-15
134+
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
version:
139+
- 3.10.18
140+
- 3.11.13
141+
- 3.12.11
142+
- 3.13.5
143+
arch:
144+
- arm64
145+
146+
env:
147+
RELENV_DATA: ${{ github.workspace }}
148+
149+
steps:
150+
- uses: actions/checkout@v3
151+
152+
- name: Patch include
153+
run: |
154+
sudo mkdir /tmp/local
155+
sudo mv -f /usr/local/* /tmp/local/
156+
157+
- name: Set up Python 3.11
158+
uses: actions/setup-python@v5
159+
with:
160+
python-version: '3.11'
161+
162+
- name: Show environment
163+
run: |
164+
env
165+
166+
- name: Install nox
167+
run: |
168+
brew install nox
169+
170+
- name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz"
171+
uses: actions/download-artifact@v4
172+
with:
173+
name: ${{ matrix.version }}-${{ matrix.arch }}-macos.tar.xz
174+
path: build/
175+
176+
- name: Verify Build
177+
run: |
178+
nox -e tests -- tests/test_verify_build.py
179+
180+
- name: MacOS Logs
181+
uses: actions/upload-artifact@v4
182+
if: always()
183+
with:
184+
name: ${{ matrix.version }}-${{ matrix.arch }}-macos-logs
185+
path: logs/*
186+
retention-days: 5
187+
188+
189+
test_windows:
190+
name: "Python Windows"
191+
runs-on: windows-latest
192+
193+
strategy:
194+
fail-fast: false
195+
matrix:
196+
version:
197+
- 3.10.18
198+
- 3.11.13
199+
- 3.12.11
200+
- 3.13.5
201+
arch:
202+
- amd64
203+
- x86
204+
205+
env:
206+
RELENV_DATA: ${{ github.workspace }}
207+
208+
steps:
209+
- uses: actions/checkout@v3
210+
211+
- name: Set up Python 3.10
212+
uses: actions/setup-python@v5
213+
with:
214+
python-version: '3.10'
215+
216+
- name: Install VS Build Tools
217+
run: |
218+
relenv/_scripts/install_vc_build.ps1
219+
220+
- name: Install nox
221+
run: |
222+
pip3 install nox
223+
224+
- name: "Download artifact: build/${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz"
225+
uses: actions/download-artifact@v4
226+
with:
227+
name: ${{ matrix.version }}-${{ matrix.arch }}-win.tar.xz
228+
path: build/
229+
230+
- name: Verify Build
231+
if: ${{ matrix.arch == 'amd64' }}
232+
run: |
233+
nox -e tests -- tests/test_verify_build.py
234+
235+
- name: Upload Build Logs
236+
uses: actions/upload-artifact@v4
237+
if: always()
238+
with:
239+
name: ${{ matrix.version }}-${{ matrix.arch }}-windows-logs
240+
path: logs/*
241+
retention-days: 5

0 commit comments

Comments
 (0)