chore(deps): update actions/checkout action to v6 #189
This file contains hidden or 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
| name: llvmlite_osx-arm64_wheel_builder | |
| on: | |
| pull_request: | |
| paths: | |
| - .github/workflows/llvmlite_osx-arm64_wheel_builder.yml | |
| workflow_dispatch: | |
| inputs: | |
| llvmdev_run_id: | |
| description: 'llvmdev workflow run ID (optional)' | |
| required: false | |
| type: string | |
| upload_wheel_to_anaconda: | |
| description: 'Upload wheel to Anaconda Cloud - numba channel' | |
| required: false | |
| type: boolean | |
| default: false | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| FALLBACK_LLVMDEV_VERSION: "20" | |
| CONDA_CHANNEL_NUMBA: numba/label/llvm20-wheel | |
| VALIDATION_PYTHON_VERSION: "3.12" | |
| ARTIFACT_RETENTION_DAYS: 7 | |
| jobs: | |
| osx-arm64-build: | |
| name: osx-arm64-build | |
| runs-on: macos-14 | |
| defaults: | |
| run: | |
| shell: bash -elx {0} | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| fail-fast: false | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| - name: Download llvmdev Artifact | |
| if: ${{ inputs.llvmdev_run_id != '' }} | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: llvmdev_for_wheel_osx-arm64 | |
| path: llvmdev_conda_packages | |
| run-id: ${{ inputs.llvmdev_run_id }} | |
| repository: ${{ github.repository }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install build dependencies | |
| run: | | |
| if [ "${{ inputs.llvmdev_run_id }}" != "" ]; then | |
| CHAN="file://${{ github.workspace }}/llvmdev_conda_packages" | |
| conda install -c defaults -c "$CHAN" "llvmdev=${{ env.FALLBACK_LLVMDEV_VERSION }}" | |
| else | |
| CHAN="${{ env.CONDA_CHANNEL_NUMBA }}" | |
| conda install -c defaults "${CHAN}::llvmdev=${{ env.FALLBACK_LLVMDEV_VERSION }}" | |
| fi | |
| python -m pip install build wheel setuptools | |
| # Hide libunwind to prevent it from being linked against during build | |
| # On macOS, if libunwind.dylib from the llvmdev conda package gets linked, the resulting wheel | |
| # will have a runtime dependency on @rpath/libunwind.1.dylib. | |
| # This breaks the wheel in clean environments, causing `OSError: Library not loaded: @rpath/libunwind.1.dylib` | |
| # Please refer here for detailed logs: https://gist.github.com/swap357/94d468e192ef9f4b12657cef26bb8779 | |
| mkdir -p "$CONDA_PREFIX/lib/hide_unwind" | |
| mv "$CONDA_PREFIX/lib/libunwind"*.dylib "$CONDA_PREFIX/lib/hide_unwind/" 2>/dev/null || true | |
| - name: Build wheel | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: "11.0" | |
| LLVMLITE_PACKAGE_FORMAT: "wheel" | |
| LDFLAGS: "-v -Wl,-rpath,/usr/lib" | |
| run: | | |
| arch -arm64 python -m build --wheel --no-isolation | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: llvmlite-osx-arm64-py${{ matrix.python-version }} | |
| path: dist/*.whl | |
| compression-level: 0 | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: error | |
| - name: Build sdist [once - py3.10] | |
| if: ${{ matrix.python-version == '3.10' }} | |
| run: arch -arm64 python -m build --sdist --no-isolation | |
| - name: Upload sdist (once with python 3.10) | |
| if: ${{ matrix.python-version == '3.10' }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: llvmlite-sdist | |
| path: dist/*.tar.gz | |
| compression-level: 0 | |
| retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }} | |
| if-no-files-found: error | |
| - name: Show Workflow Run ID | |
| run: "echo \"Workflow Run ID: ${{ github.run_id }}\"" | |
| osx-arm64-validate: | |
| name: osx-arm64-validate | |
| needs: osx-arm64-build | |
| runs-on: macos-14 | |
| defaults: | |
| run: | |
| shell: bash -elx {0} | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| fail-fast: false | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 | |
| with: | |
| python-version: ${{ env.VALIDATION_PYTHON_VERSION }} | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| - name: Install validation dependencies | |
| run: conda install -c defaults wheel twine keyring rfc3986 | |
| - name: Download llvmlite wheels | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: llvmlite-osx-arm64-py${{ matrix.python-version }} | |
| path: dist | |
| - name: Validate wheels | |
| run: | | |
| cd dist | |
| twine check ./*.whl | |
| osx-arm64-test: | |
| name: osx-arm64-test | |
| needs: osx-arm64-build | |
| runs-on: macos-14 | |
| defaults: | |
| run: | |
| shell: bash -elx {0} | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| fail-fast: false | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Download llvmlite wheel | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: llvmlite-osx-arm64-py${{ matrix.python-version }} | |
| path: dist | |
| - name: Install and test | |
| env: | |
| LLVMLITE_DIST_TEST: "1" | |
| run: | | |
| PYTHON_PATH=$(which "python${{ matrix.python-version }}") | |
| "$PYTHON_PATH" -m venv .venv && source .venv/bin/activate | |
| python -m pip install --upgrade pip wheel | |
| echo "Installing lief for distribution testing" | |
| python -m pip install -v lief | |
| cd dist && python -m pip install -v ./*.whl | |
| DYLIB_PATH=$(find "$(python -c "import llvmlite; print(llvmlite.__path__[0])")" -name "libllvmlite.dylib") | |
| echo "Found dylib at: $DYLIB_PATH" && otool -L "$DYLIB_PATH" | |
| python -m llvmlite.tests | |
| osx-arm64-upload: | |
| name: osx-arm64-upload | |
| needs: osx-arm64-test | |
| if: github.event_name == 'workflow_dispatch' && inputs.upload_wheel_to_anaconda | |
| runs-on: macos-14 | |
| defaults: | |
| run: | |
| shell: bash -elx {0} | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| fail-fast: false | |
| steps: | |
| - name: Setup Miniconda | |
| uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0 | |
| with: | |
| python-version: ${{ env.VALIDATION_PYTHON_VERSION }} | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| - name: Install anaconda-client | |
| run: conda install -c anaconda anaconda-client | |
| - name: Download llvmlite wheel | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: llvmlite-osx-arm64-py${{ matrix.python-version }} | |
| path: dist | |
| - name: Upload wheel to Anaconda Cloud | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.NUMBA_CHANNEL_WHEEL_UPLOAD }} | |
| run: | | |
| cd dist | |
| whl=$(stat -f "%m %N" ./*.whl | sort -n | tail -n 1 | cut -d' ' -f2-) | |
| echo "Uploading wheel: $whl" | |
| anaconda -t "$ANACONDA_API_TOKEN" upload --force -u numba -l dev "$whl" |