-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: 🎡 fix macOS CI (restore build deps cache)
- Loading branch information
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ jobs: | |
env: | ||
PCRE_VERSION: "8.45" | ||
|
||
outputs: | ||
build-deps-cache-key: ${{ steps.build-deps-cache-key.outputs.value }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
|
@@ -57,6 +59,12 @@ jobs: | |
/opt/vectorscan | ||
/opt/pcre | ||
- name: Capture build dependencies cache key | ||
if: startsWith(matrix.os, 'macos') && steps.build-deps-macos.outputs.cache-hit != 'true' | ||
id: build-deps-cache-key | ||
run: | | ||
echo "value=${{ startsWith(matrix.os, 'macos') && steps.build-deps-macos.outputs.cache-primary-key || '' }}" >> $GITHUB_OUTPUT | ||
build_wheels: | ||
name: ${{ matrix.python_id }}-${{ matrix.platform_id }} wheel | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -211,7 +219,7 @@ jobs: | |
- if: ${{ !endsWith(matrix.os, '-arm') }} | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: "${{ matrix.python }}" | ||
python-version: ${{ matrix.python }} | ||
cache: true | ||
|
||
# XXX: deadsnakes does not provide Python 3.10 for ubuntu 20.04 (jammy) | ||
|
@@ -220,7 +228,7 @@ jobs: | |
- if: ${{ endsWith(matrix.os, '-arm') && !endsWith(matrix.python_id, '310') }} | ||
uses: deadsnakes/[email protected] | ||
with: | ||
python-version: "${{ matrix.python }}" | ||
python-version: ${{ matrix.python }} | ||
|
||
- if: ${{ endsWith(matrix.os, '-arm') }} | ||
name: Install PDM | ||
|
@@ -236,6 +244,23 @@ jobs: | |
run: | | ||
echo "version=$(pdm run semantic-release version --no-commit 2>/dev/null)" >> "$GITHUB_OUTPUT" | ||
- name: Setup macOS environment | ||
if: startsWith(matrix.os, 'macos') | ||
run: | | ||
gid=$(id -g) | ||
uid=$(id -u) | ||
sudo mkdir -p /opt/vectorscan /opt/pcre | ||
sudo chown -R $uid:$gid /opt/vectorscan /opt/pcre | ||
- name: Restore build dependencies cache | ||
if: startsWith(matrix.os, 'macos') | ||
uses: actions/cache/restore@v4 | ||
with: | ||
key: ${{ needs.build_environment.outputs.build-deps-cache-key }} | ||
path: | | ||
/opt/vectorscan | ||
/opt/pcre | ||
- name: Restore build artifacts cache | ||
id: cache-wheels | ||
uses: actions/cache/restore@v4 | ||
|
@@ -247,8 +272,8 @@ jobs: | |
- name: Build and test wheels | ||
if: steps.cache-wheels.outputs.cache-hit != 'true' | ||
env: | ||
PCRE_VERSION: "${{env.PCRE_VERSION}}" | ||
CIBW_ARCHS_MACOS: "${{ matrix.platform_id == 'macosx_arm64' && 'arm64' || 'x86_64' }}" | ||
PCRE_VERSION: ${{env.PCRE_VERSION}} | ||
CIBW_ARCHS_MACOS: ${{ matrix.platform_id == 'macosx_arm64' && 'arm64' || 'x86_64' }} | ||
CIBW_ARCHS_LINUX: auto aarch64 | ||
CIBW_BUILD: ${{ matrix.python_id }}-${{ matrix.platform_id }} | ||
CIBW_BUILD_VERBOSITY: 1 | ||
|