Skip to content

Commit

Permalink
Use explicit runner in build and merge matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Feb 14, 2024
1 parent 6868ecb commit edd2401
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
33 changes: 29 additions & 4 deletions .cibw/setup-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def pp3(y_min=7, y_max=10):

OS_ARCH_PY = {
"Linux": {
"x86_64": cp3() + pp3(),
"aarch64": cp3() + pp3(),
"ppc64le": cp3(),
"x86_64": cp3() + pp3(),
},
"macOS": {
"x86_64": cp3() + pp3(),
"arm64": cp3(8, 12),
"x86_64": cp3() + pp3(),
},
"Windows": {
"AMD64": cp3() + pp3(),
Expand All @@ -55,6 +55,24 @@ def pp3(y_min=7, y_max=10):
"Windows": MPI_ABI_WINNT[:],
}

GHA_RUNNER = {
"Linux": {
"aarch64": "ubuntu-latest",
"ppc64le": "ubuntu-latest",
"x86_64": "ubuntu-latest",
None: "ubuntu-latest"
},
"macOS": {
"arm64": "macos-11",
"x86_64": "macos-11",
None: "macos-latest"
},
"Windows": {
"AMD64": "windows-2019",
None: "windows-latest"
},
}

os_arch_py = copy.deepcopy(OS_ARCH_PY)
if opts.os and not set(opts.os) & {"*", "all"}:
select = collections.defaultdict(list)
Expand All @@ -81,14 +99,21 @@ def pp3(y_min=7, y_max=10):
os_arch_py[os][arch][:] = opts.py

matrix_build = [
{"os": os, "arch": arch, "py": py, "mpi-abi": mpi_abi}
{
"os": os, "arch": arch,
"py": py, "mpi-abi": mpi_abi,
"runner": GHA_RUNNER[os][arch],
}
for os in os_arch_py
for arch in os_arch_py[os]
for py in os_arch_py[os][arch]
for mpi_abi in MPI_ABI[os]
]
matrix_merge = [
{"os": os, "arch": arch}
{
"os": os, "arch": arch,
"runner": GHA_RUNNER[os][None],
}
for os in os_arch_py
for arch in os_arch_py[os]
]
Expand Down
2 changes: 1 addition & 1 deletion .cibw/setup-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
if f"{mpiname}-{mpiversion}" == "openmpi-3.1":
continue
if (py == "cp" and (x, y) == (3, 6)
and f"{mpiname}-{mpiversion}" == "openmpi-5.0"):
and f"{mpiname}-{mpiversion}" == "openmpi-5.0"):
continue # python=3.6 openmpi=5.0 cannot be solved
row = {
"runner": runner,
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/cd-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ jobs:
build:
if: ${{ needs.setup.outputs.matrix-build != '[]' }}
needs: setup
runs-on: ${{ (matrix.os == 'Linux' && 'ubuntu-latest') ||
(matrix.os == 'macOS' && 'macos-11' ) ||
(matrix.os == 'Windows' && 'windows-2019' ) }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -191,9 +189,7 @@ jobs:
merge:
if: ${{ needs.setup.outputs.matrix-merge != '[]' }}
needs: [setup, build]
runs-on: ${{ (matrix.os == 'Linux' && 'ubuntu-latest' ) ||
(matrix.os == 'macOS' && 'macos-latest' ) ||
(matrix.os == 'Windows' && 'windows-latest' ) }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit edd2401

Please sign in to comment.