Skip to content

Commit

Permalink
fix(ci): wheels skip all steps (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: l.feng <[email protected]>
  • Loading branch information
msclock authored Dec 15, 2024
1 parent 524ebde commit fcd1c15
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 59 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CD

on:
workflow_dispatch:

schedule:
- cron: 0 0 * * 5
release:
types:
- published
Expand Down Expand Up @@ -36,8 +37,8 @@ jobs:
uses: ./.github/workflows/reuseable_cibuildwheel.yml
secrets: inherit
with:
auto-archs: true
extral-archs: true
auto: true
extra: true


check_dist:
Expand All @@ -58,6 +59,7 @@ jobs:
needs: [build_wheels, build_sdist, check_dist]
environment:
name: pypi
url: https://pypi.org/project/ss-pybind11
permissions:
id-token: write
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
uses: ./.github/workflows/reuseable_cibuildwheel.yml
secrets: inherit
with:
auto-archs: true
extral-archs: false
auto: true
extra: false


codecov:
Expand Down Expand Up @@ -174,6 +174,7 @@ jobs:
if: always()
needs:
- wheels
- codecov
- check-docs
- check-mkdocs-docs
runs-on: ubuntu-24.04
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/reuseable_cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,65 @@ name: cibuildwheel
on:
workflow_call:
inputs:
auto-archs:
auto:
description: Build wheels for auto archs
required: true
type: boolean
extral-archs:
extra:
description: Build wheels for aarch64 armv7l ppc64le & s390x
required: true
type: boolean

jobs:
build_wheels:
name: Build ${{ matrix.build }}-${{ matrix.arch }} wheels on ${{ matrix.os }}
name: On ${{ matrix.os }}, with ${{ matrix.arch }}, build ${{ matrix.build }} wheels
runs-on: ${{ matrix.os }}

strategy:
matrix:
build: [manylinux, musllinux]
arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686]
os: [ubuntu-24.04] # renovate: github-runner
use_qemu: [true]
arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686]
build: [manylinux, musllinux]
qemu_arch: [aarch64 ppc64le s390x armv7l]
include:
- {os: windows-2019, arch: AMD64, build: win, use_qemu: false}
- {os: windows-2019, arch: x86, build: win, use_qemu: false}
- {os: windows-2022, arch: ARM64, build: win, use_qemu: false}
- {os: macos-13, arch: x86_64, build: macos, use_qemu: false}
- {os: macos-14, arch: arm64, build: macos, use_qemu: false}
- {os: windows-2019, arch: AMD64, build: win}
- {os: windows-2019, arch: x86, build: win}
- {os: windows-2022, arch: ARM64, build: win}
- {os: macos-13, arch: x86_64, build: macos}
- {os: macos-14, arch: arm64, build: macos}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
with:
fetch-depth: 0

- name: Set up msvc on Windows
if: runner.os == 'Windows' && github.event.inputs.auto-archs && !matrix.use_qemu
if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch)
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
with:
arch: ${{ matrix.arch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
if: runner.os == 'Linux' && github.event.inputs.extral-archs && matrix.use_qemu
if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch)

- name: Build wheels
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: '*${{ matrix.build }}*'

- name: Upload wheels
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: cibw-${{ matrix.build }}-${{ matrix.arch }}-${{ matrix.os }}
name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }}
path: wheelhouse/*.whl
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["src/ss_pybind11/_version.py"]
cmake.args = [
"-DBUILD_TESTING=OFF",
"-DCMAKE_BUILD_TYPE=ReWithDebInfo",
"-DCMAKE_BUILD_TYPE=Release",
"-DVCPKG_INSTALL_REPORT_FAILURE=ON",
"-DVCPKG_INSTALL_OPTIONS=--allow-unsupported",
"-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: CD

on:
workflow_dispatch:

schedule:
- cron: 0 0 * * 5
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: {{ '${{ github.workflow }}-${{ github.ref }}' }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -36,8 +37,8 @@ jobs:
uses: ./.github/workflows/reuseable_cibuildwheel.yml
secrets: inherit
with:
auto-archs: true
extral-archs: true
auto: true
extra: true


check_dist:
Expand All @@ -58,6 +59,7 @@ jobs:
needs: [build_wheels, build_sdist, check_dist]
environment:
name: pypi
url: https://pypi.org/project/{{ repo_name }}
permissions:
id-token: write
runs-on: ubuntu-latest
Expand All @@ -72,6 +74,6 @@ jobs:

- uses: pypa/gh-action-pypi-publish@release/v1
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYPI_API_TOKEN: {{ '${{ secrets.PYPI_API_TOKEN }}' }}
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: {{ '${{ secrets.PYPI_API_TOKEN }}' }}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ jobs:
uses: ./.github/workflows/reuseable_cibuildwheel.yml
secrets: inherit
with:
auto-archs: true
extral-archs: false
auto: true
extra: false
[%- if use_codecov == true %]


Expand Down Expand Up @@ -190,6 +190,9 @@ jobs:
if: always()
needs:
- wheels
[%- if use_codecov == true %]
- codecov
[%- endif %]
- check-docs
[%- if repo_name == 'ss-pybind11' %]
- check-mkdocs-docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,65 @@ name: cibuildwheel
on:
workflow_call:
inputs:
auto-archs:
auto:
description: Build wheels for auto archs
required: true
type: boolean
extral-archs:
extra:
description: Build wheels for aarch64 armv7l ppc64le & s390x
required: true
type: boolean

jobs:
build_wheels:
name: Build ${{ matrix.build }}-${{ matrix.arch }} wheels on ${{ matrix.os }}
name: On ${{ matrix.os }}, with ${{ matrix.arch }}, build ${{ matrix.build }} wheels
runs-on: ${{ matrix.os }}

strategy:
matrix:
build: [manylinux, musllinux]
arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686]
os: [ubuntu-24.04] # renovate: github-runner
use_qemu: [true]
arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686]
build: [manylinux, musllinux]
qemu_arch: [aarch64 ppc64le s390x armv7l]
include:
- {os: windows-2019, arch: AMD64, build: win, use_qemu: false}
- {os: windows-2019, arch: x86, build: win, use_qemu: false}
- {os: windows-2022, arch: ARM64, build: win, use_qemu: false}
- {os: macos-13, arch: x86_64, build: macos, use_qemu: false}
- {os: macos-14, arch: arm64, build: macos, use_qemu: false}
- {os: windows-2019, arch: AMD64, build: win}
- {os: windows-2019, arch: x86, build: win}
- {os: windows-2022, arch: ARM64, build: win}
- {os: macos-13, arch: x86_64, build: macos}
- {os: macos-14, arch: arm64, build: macos}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
with:
fetch-depth: 0

- name: Set up msvc on Windows
if: runner.os == 'Windows' && github.event.inputs.auto-archs && !matrix.use_qemu
if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch)
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
with:
arch: ${{ matrix.arch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
if: runner.os == 'Linux' && github.event.inputs.extral-archs && matrix.use_qemu
if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch)

- name: Build wheels
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: '*${{ matrix.build }}*'

- name: Upload wheels
if: >
github.event.inputs.extral-archs && matrix.use_qemu ||
github.event.inputs.auto-archs && !matrix.use_qemu
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: cibw-${{ matrix.build }}-${{ matrix.arch }}-${{ matrix.os }}
name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }}
path: wheelhouse/*.whl
2 changes: 1 addition & 1 deletion template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["src/{{ module_name }}/_version.py"]
cmake.args = [
"-DBUILD_TESTING=OFF",
"-DCMAKE_BUILD_TYPE=ReWithDebInfo",
"-DCMAKE_BUILD_TYPE=Release",
"-DVCPKG_INSTALL_REPORT_FAILURE=ON",
"-DVCPKG_INSTALL_OPTIONS=--allow-unsupported",
"-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake",
Expand Down
4 changes: 2 additions & 2 deletions template/vcpkg.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
[%- endif %]
{
"name": "cmake-modules",
"version": "1.6.8"
"version": "1.6.11"
}
[%- if compiled == true %],
{
Expand All @@ -54,7 +54,7 @@
"registries": [
{
"kind": "git",
"baseline": "a1d862fc6df3883df4516ccdd0c204d14cf4dc64",
"baseline": "09ae1472980f5e2132654900bb48061444b1cea5",
"repository": "https://github.com/msclock/cmake-registry",
"packages": [
[%- if use_conan == true %]
Expand Down
4 changes: 2 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"name": "cmake-modules",
"version": "1.6.8"
"version": "1.6.11"
},
{
"name": "robotology-cmake-ycm",
Expand All @@ -27,7 +27,7 @@
"registries": [
{
"kind": "git",
"baseline": "a1d862fc6df3883df4516ccdd0c204d14cf4dc64",
"baseline": "09ae1472980f5e2132654900bb48061444b1cea5",
"repository": "https://github.com/msclock/cmake-registry",
"packages": [
"cmake-modules",
Expand Down

0 comments on commit fcd1c15

Please sign in to comment.