Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik authored Sep 7, 2024
1 parent 32a7a2b commit bcc3327
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 53 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ pip freeze
# By default, wheels are tagged with the architecture of the Python
# installation, which would produce universal2 even if only building
# for x86_64. The following line overrides that behavior.
export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-$ARCH"
export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-${PYTHON_ARCH}"

export CC=clang
export CXX=clang++
export CFLAGS="-arch $ARCH"
export CFLAGS="-arch ${PYTHON_ARCH}"
export CXXFLAGS=$CFLAGS
export LDFLAGS=$CFLAGS
export ARCHFLAGS=$CFLAGS
Expand All @@ -54,7 +54,7 @@ python setup.py bdist_wheel
# no shared library dependencies that have to be bundled.

delocate-listdeps --all --depending dist/*.whl # lists library dependencies
delocate-wheel --verbose --require-archs=$ARCH dist/*.whl # copies library dependencies into wheel
delocate-wheel --verbose --require-archs=${PYTHON_ARCH} dist/*.whl # copies library dependencies into wheel
delocate-listdeps --all --depending dist/*.whl # verify

# Dump target versions of dependend libraries.
Expand Down
5 changes: 2 additions & 3 deletions .github/scripts/build-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function Initialize-Python {
}
# Check Python version/arch
exec { python -c "import platform; assert platform.python_version().startswith('$env:PYTHON_VERSION')" }
exec { python -c "import struct; assert struct.calcsize('P') * 8 == $env:PYTHON_ARCH" }
}

function Create-VEnv {
Expand Down Expand Up @@ -63,8 +62,8 @@ function Exit-VEnv {
if (!$env:PYTHON_VERSION) {
throw "PYTHON_VERSION env var missing, must be x.y"
}
if ($env:PYTHON_ARCH -ne '32' -and $env:PYTHON_ARCH -ne '64') {
throw "PYTHON_ARCH env var must be 32 or 64"
if ($env:PYTHON_ARCH -ne 'x86' -and $env:PYTHON_ARCH -ne 'x86_64') {
throw "PYTHON_ARCH env var must be x86 or x86_64"
}
if (!$env:NUMPY_VERSION) {
throw "NUMPY_VERSION env var missing"
Expand Down
98 changes: 51 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,87 +40,91 @@ jobs:
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.9'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.9'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: windows-latest
os-name: windows
python-version: '3.9'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.10'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.11'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.12'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'

permissions:
Expand Down Expand Up @@ -171,15 +175,15 @@ jobs:
if: matrix.config.os-name == 'mac'
run: .github/scripts/build-macos.sh
env:
ARCH: ${{ matrix.config.arch }}
PYTHON_ARCH: ${{ matrix.config.python-arch }}
MACOS_MIN_VERSION: ${{ matrix.config.macos-min-version }}
PYTHON_VERSION: ${{ matrix.config.python-version }}
NUMPY_VERSION: ${{ matrix.config.numpy-version }}

- name: Store wheel as artifact
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheel-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }}
path: dist

# - name: Perform CodeQL Analysis
Expand All @@ -198,87 +202,91 @@ jobs:
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.9'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: ubuntu-latest
os-name: linux
docker-image: quay.io/pypa/manylinux2014_x86_64
python-arch: 'x86_64'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.9'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: macos-12
os-name: mac
arch: x86_64
python-arch: x86_64
macos-min-version: '10.9'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.10'
numpy-version: '2.0.*'
- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.11'
numpy-version: '2.0.*'
- os-image: macos-14 # M1
os-name: mac
arch: arm64
python-arch: arm64
macos-min-version: '11.0'
python-version: '3.12'
numpy-version: '2.0.*'

- os-image: windows-latest
os-name: windows
python-version: '3.9'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.10'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.11'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'
- os-image: windows-latest
os-name: windows
python-version: '3.12'
python-arch: '64'
python-arch: 'x86_64'
numpy-version: '2.0.*'

runs-on: ${{ matrix.config.os-image }}
Expand All @@ -291,10 +299,10 @@ jobs:
with:
submodules: true

- name: Download wheels from artifact storage
- name: Download wheel from artifact storage
uses: actions/download-artifact@v4
with:
name: wheels
name: wheel-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }}
path: dist

- name: Test wheel (Linux)
Expand Down Expand Up @@ -333,14 +341,14 @@ jobs:
.github/scripts/install-macos-obs-virtual-cam.sh
.github/scripts/test-macos.sh
env:
ARCH: ${{ matrix.config.arch }}
PYTHON_ARCH: ${{ matrix.config.python-arch }}
PYTHON_VERSION: ${{ matrix.config.python-version }}

- name: Store test captures as artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test_captures
name: test_captures-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }}
path: 'tmp_for_test/*.png'
if-no-files-found: ignore

Expand All @@ -360,7 +368,8 @@ jobs:
- name: Download wheels from artifact storage
uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheel-*
merge-multiple: true
path: dist

- name: Install from wheel
Expand All @@ -372,9 +381,8 @@ jobs:
run: sphinx-build -b html docs dist-docs

- name: Store docs HTML as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-pages-artifact@v3
with:
name: docs
path: dist-docs

publish-wheels:
Expand All @@ -388,7 +396,8 @@ jobs:
- name: Download wheels from artifact storage
uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheel-*
merge-multiple: true
path: dist

- name: Setup Python
Expand All @@ -407,19 +416,14 @@ jobs:
needs: [publish-wheels]

permissions:
contents: write
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

steps:
- name: Download docs HTML from artifact storage
uses: actions/download-artifact@v4
with:
name: docs
path: dist-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# TODO replace with https://github.com/actions/deploy-pages once out of beta
- name: Upload docs to GitHub Pages
uses: peaceiris/actions-gh-pages@47a6d63ea8b47b19328e258563aa1fbe224c0a23
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist-docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit bcc3327

Please sign in to comment.