Skip to content

🦄 (deps): Bump the actions group across 1 directory with 2 updates #538

🦄 (deps): Bump the actions group across 1 directory with 2 updates

🦄 (deps): Bump the actions group across 1 directory with 2 updates #538

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
CIBW_BUILD_VERBOSITY: 2
CIBW_SKIP: "pp* *musllinux*"
CIBW_BUILD_FRONTEND: "build"
jobs:
style:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12
- name: Run style checks
run: pipx run pre-commit run --all-files
check_commit_message:
needs: [style]
name: Check commit message
runs-on: ubuntu-latest
outputs:
trigger: ${{ steps.check-commit-message.outputs.trigger }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check commit message
id: check-commit-message
run: |
set -e -x
COMMIT_MESSAGE=$(git log --no-merges -1 --oneline)
if [[ "$GITHUB_EVENT_NAME" == pull_request &&
"$COMMIT_MSG" =~ \[buildjet\] ]]; then
echo "trigger=true" >> "$GITHUB_OUTPUT"
fi
- name: Run BuildJet runners
if: steps.check-commit-message.outputs.trigger == 'true'
run: echo "Running BuildJet runners"
build_wheels:
needs: [style]
name: ${{ matrix.runs-on }}-python-${{ matrix.python-version }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "3.13"]
runs-on: [ubuntu-latest, macos-13, macos-14, windows-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up Go toolchain
id: setup-go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: "1.23.2"
cache: false
check-latest: true
- name: Install MinGW on Windows
if: matrix.runs-on == 'windows-latest'
run: choco install mingw
- name: Restore Hugo builder cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ./hugo_cache/
key: ${{ matrix.runs-on }}-hugo-${{ steps.setup-go.outputs.go-version }}
- name: Install Python dependencies
run: python -m pip install build virtualenv nox
- name: Build binary distribution (wheel)
run: |
python -m build --wheel . --outdir wheelhouse/
- name: Test entry points for package
run: nox -s venv
build_wheels_linux_aarch64:
needs: [check_commit_message]
name: linux-aarch64-buildjet-python-3.12
runs-on: buildjet-2vcpu-ubuntu-2204-arm
if: ${{ needs.check_commit_message.outputs.trigger == 'true' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: buildjet/setup-python@v5.2.0
- uses: buildjet/setup-go@af85c03c2736c2267d5afe4d5952023a3b64bf89 # v5.0.0
with:
go-version: "1.23.2"
cache: false
check-latest: true
- name: Build binary distribution (wheel) on Linux (aarch64)
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_LINUX: aarch64
CIBW_BEFORE_ALL_LINUX: |
tarball="go1.23.2.linux-arm64.tar.gz"
curl -LJO https://golang.org/dl/$tarball
mkdir $HOME/go_installed/
tar -C $HOME/go_installed/ -xzf $tarball
export PATH=$PATH:$HOME/go_installed/go/bin >> ~/.bashrc
export PATH=$PATH:$HOME/go_installed/go/bin >> ~/.bash_profile
go version
CIBW_ENVIRONMENT_LINUX: PATH=$PATH:$HOME/go_installed/go/bin
CIBW_TEST_COMMAND: |
hugo version
hugo env --logLevel debug
experimental:
needs: [style]
name: zig-${{ matrix.runs-on }}-${{ matrix.architecture }}-python-${{ matrix.python-version }}
env:
CIBW_BUILD_VERBOSITY: 2
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-latest]
architecture: [arm64, i686]
python-version: ["3.9", "3.12", "3.13"]
# Exclude i686 on Linux for all Python versions
# Test just one Python version on Windows for now
exclude:
- runs-on: ubuntu-latest
architecture: i686
- python-version: "3.9"
runs-on: windows-latest
- python-version: "3.13"
runs-on: windows-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up Go toolchain
id: setup-go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: "1.23.2"
cache: false
check-latest: true
- uses: mlugg/setup-zig@a67e68dc5c8281d9608136d3d7ca1b282213e4ac # v1.2.1
with:
version: 0.13.0
- name: Restore Hugo builder cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ./hugo_cache/
key: zig-${{ matrix.runs-on }}-${{ matrix.architecture}}-hugo-experimental-${{ steps.setup-go.outputs.go-version }}
- name: Install Python dependencies
run: python -m pip install build virtualenv nox auditwheel
- name: Build binary distribution (wheel) on Linux
if: matrix.runs-on == 'ubuntu-latest'
# Cross-compile for arm64 target via Zig toolchain
env:
USE_ZIG: 1
GOOS: linux
GOARCH: arm64
run: |
python -m build --wheel . --outdir wheelhouse/
# can't repair arm64 wheels on Linux x86_64 right now
# auditwheel repair --plat manylinux_2_28_aarch64 -w wheelhouse/ dist/*.whl
- name: Build binary distribution (wheel) on Windows (arm64)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'arm64'
# We need to use cibuildwheel because it has experimental support for cross-compiling
# to arm64 and setup-python does not have arm64 support on Windows right now
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for arm64 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: arm64
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: ARM64
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_SKIP: "*-win_arm64"
# Note: cibuildwheel will manage installing 32-bit Python on Windows. We
# do not need to do that manually unless we use setup-python instead.
- name: Build binary distribution (wheel) on Windows (i686)
if: matrix.runs-on == 'windows-latest' && matrix.architecture == 'i686'
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
package-dir: .
output-dir: wheelhouse
# Cross-compile for i686 target via Zig toolchain
env:
USE_ZIG: "1"
GOOS: windows
GOARCH: 386
CIBW_BUILD: "cp312-*"
CIBW_ARCHS_WINDOWS: x86
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: delvewheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: |
hugo version
hugo env --logLevel debug
- name: Upload artifacts for debugging
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: wheels_${{ matrix.runs-on }}_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: ./wheelhouse/*.whl
inspect_distributions:
needs: [style]
name: inspect-sdist-wheel-contents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.12
- name: Build source distribution (SDist) and binary distribution (wheel)
run: |
pipx run build --sdist --wheel . --outdir dist/
pipx run twine check dist/* --strict
- name: Build, inspect, and display contents of distributions
shell: bash
run: |
mkdir -p output/sdist
tar -xf dist/*.tar.gz -C output/sdist
echo -e '## View source distribution (SDist) contents\n' >> $GITHUB_STEP_SUMMARY
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
(cd output/sdist && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY
mkdir -p output/wheel
pipx run wheel unpack dist/*.whl -d output/wheel
echo -e '## View binary distribution (wheel) contents\n' >> $GITHUB_STEP_SUMMARY
echo -e '```\n' >> $GITHUB_STEP_SUMMARY
(cd output/wheel && tree -a * | sed 's/^/ /' | tee -a $GITHUB_STEP_SUMMARY)
echo -e '\n```\n' >> $GITHUB_STEP_SUMMARY