|
| 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