Skip to content

CI: Another shot at fixing macOS wheel builds #54487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Aug 10, 2023
47 changes: 17 additions & 30 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ name: Wheel builder

on:
schedule:
# 3:27 UTC every day
- cron: "27 3 * * *"
# 8:50 UTC every day
- cron: "50 8 * * *"
push:
pull_request:
types: [labeled, opened, synchronize, reopened]
Expand All @@ -35,7 +35,7 @@ jobs:
build_sdist:
name: Build sdist
if: >-
(github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
(github.event_name == 'schedule') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
Expand Down Expand Up @@ -67,6 +67,10 @@ jobs:
name: sdist
path: ./dist/*

- name: Sanity check sdist files
run: |
ls ./dist

- name: Output sdist name
id: save-path
shell: bash -el {0}
Expand All @@ -76,7 +80,7 @@ jobs:
needs: build_sdist
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
if: >-
(github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
(github.event_name == 'schedule') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
Expand Down Expand Up @@ -111,45 +115,28 @@ jobs:
# We need to build wheels from the sdist since the sdist
# removes unnecessary files from the release
- name: Download sdist (not macOS)
if: ${{ matrix.buildplat[1] != 'macosx_*' }}
#if: ${{ matrix.buildplat[1] != 'macosx_*' }}
uses: actions/download-artifact@v3
with:
name: sdist
path: ./dist

- name: Set up Python (macOS)
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
uses: actions/setup-python@v4
with:
python-version: '3.11'

# Work around for https://github.com/actions/runner-images/issues/2619?
# Empty disk and memory cache
- name: Purge on macOS
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
run: |
sudo /usr/sbin/purge
- name: Output sdist name (macOS)
id: save-path
shell: bash -el {0}
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"

# Python version used to build sdist doesn't matter
# wheel will be built from sdist with the correct version
- name: Build sdist (macOS)
- name: Unzip sdist (macOS)
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
run: |
python -m pip install build
python -m build --sdist
tar -xzf ./dist/${{ env.sdist_name }} -C ./dist

- name: Output sdist name (macOS)
id: save-path
id: save-path2
shell: bash -el {0}
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"

# Work around for https://github.com/actions/runner-images/issues/2619?
# Empty disk and memory cache
# Again for good luck :)
- name: Purge on macOS again
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
run: |
sudo /usr/sbin/purge
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"

- name: Build wheels
uses: pypa/[email protected]
Expand Down