[LLVM] Bump to cdb525d2e (#271) #1371
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
| # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| # See https://llvm.org/LICENSE.txt for license information. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| # Copyright (c) 2024. | |
| name: "Build, test, release EUDSL" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| force_debug_with_tmate: | |
| type: boolean | |
| description: 'Run the build with tmate session' | |
| required: false | |
| default: false | |
| debug_with_tmate: | |
| type: boolean | |
| description: 'Run the build with a tmate session ONLY in case of failure' | |
| required: false | |
| default: false | |
| workflow_call: | |
| inputs: | |
| workflow_call: | |
| description: 'To distinguish workflow_call from regular push' | |
| type: boolean | |
| required: false | |
| default: true | |
| workflow_caller_run_id: | |
| description: '' | |
| type: string | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/build_test_release_eudsl.yml" | |
| - "projects/eudsl-tblgen/**" | |
| - "projects/eudsl-nbgen/**" | |
| - "projects/eudsl-py/**" | |
| - "projects/eudsl-llvmpy/**" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/build_test_release_eudsl.yml" | |
| - "projects/eudsl-tblgen/**" | |
| - "projects/eudsl-nbgen/**" | |
| - "projects/eudsl-py/**" | |
| - "projects/eudsl-llvmpy/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.sha }}-build_test_release_eudsl | |
| cancel-in-progress: true | |
| jobs: | |
| build-eudsl: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "ubuntu_x86_64" | |
| runs-on: "ubuntu-22.04" | |
| os: "ubuntu" | |
| host-arch: "x86_64" | |
| target-arch: "x86_64" | |
| - name: "ubuntu_aarch64" | |
| runs-on: "ubuntu-22.04-arm" | |
| os: "ubuntu" | |
| host-arch: "aarch64" | |
| target-arch: "aarch64" | |
| - name: "windows_amd64" | |
| runs-on: "windows-2022" | |
| os: "windows" | |
| host-arch: "amd64" | |
| target-arch: "amd64" | |
| - name: "macos_arm64" | |
| runs-on: "macos-14" | |
| os: "macos" | |
| host-arch: "arm64" | |
| target-arch: "arm64" | |
| runs-on: ${{ matrix.runs-on }} | |
| name: "Build eudsl ${{ matrix.name }}" | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| # either the PR number or `branch-N` where N always increments | |
| cache-key: eudsl_${{ matrix.name }}_clang_${{ format('{0}-{1}', github.ref_name, github.run_number) }} | |
| steps: | |
| - name: "Check out repository" | |
| uses: actions/checkout@v4.2.2 | |
| - name: "Setup base" | |
| uses: ./.github/actions/setup_base | |
| id: setup_base | |
| with: | |
| cache-key: ${{ env.cache-key }} | |
| restore-key: "eudsl_${{ matrix.name }}_clang" | |
| os: ${{ matrix.os }} | |
| host-arch: ${{ matrix.host-arch }} | |
| target-arch: ${{ matrix.target-arch }} | |
| - name: "Pip download MLIR from releases" | |
| if: ${{ !inputs.workflow_call }} | |
| run: | | |
| pip download mlir-wheel -f https://llvm.github.io/eudsl | |
| - name: Download LLVM distro artifacts | |
| if: ${{ inputs.workflow_call }} | |
| uses: dawidd6/action-download-artifact@v11 | |
| with: | |
| name: mlir_wheel_${{ (matrix.name == 'ubuntu_x86_64' || matrix.name == 'ubuntu_aarch64') && 'manylinux' || matrix.os }}_${{ matrix.target-arch }}_artifact | |
| path: "./" | |
| run_id: ${{ inputs.workflow_caller_run_id }} | |
| - name: "Configure build" | |
| run: | | |
| unzip -q mlir_wheel*.whl | |
| mv mlir_wheel llvm-install | |
| if [[ "${{ matrix.os }}" == "ubuntu" ]]; then | |
| echo "LLVM_DIR=/host/$PWD/llvm-install/lib/cmake/llvm" >> $GITHUB_ENV | |
| echo "MLIR_DIR=/host/$PWD/llvm-install/lib/cmake/mlir" >> $GITHUB_ENV | |
| echo "Clang_DIR=/host/$PWD/llvm-install/lib/cmake/clang" >> $GITHUB_ENV | |
| echo "PIP_FIND_LINKS=/host/$PWD/wheelhouse" >> $GITHUB_ENV | |
| else | |
| echo "LLVM_DIR=$PWD/llvm-install/lib/cmake/llvm" >> $GITHUB_ENV | |
| echo "MLIR_DIR=$PWD/llvm-install/lib/cmake/mlir" >> $GITHUB_ENV | |
| echo "Clang_DIR=$PWD/llvm-install/lib/cmake/clang" >> $GITHUB_ENV | |
| echo "PIP_FIND_LINKS=$PWD/wheelhouse" >> $GITHUB_ENV | |
| fi | |
| $python3_command -m pip install cibuildwheel | |
| if [[ "${{ matrix.os }}" == "ubuntu" ]] && [[ "${{ matrix.host-arch }}" == "aarch64" ]]; then | |
| sudo apt-get install libarchive-dev antlr libxml2-dev libxslt-dev libcurl4-openssl-dev | |
| fi | |
| if [[ "${{ matrix.os }}" == "macos" ]]; then | |
| brew install antlr boost libarchive | |
| fi | |
| $python3_command -m pip install -r requirements-dev.txt -v | |
| - name: "Build eudsl-tblgen" | |
| run: | | |
| # this one is different from the rest as a smoketest re cibuildwheel | |
| if [[ "${{ matrix.os }}" == "ubuntu" ]]; then | |
| export CCACHE_DIR=/host/$CCACHE_DIR | |
| export CC=clang | |
| export CXX=clang++ | |
| fi | |
| $python3_command -m cibuildwheel "$PWD/projects/eudsl-tblgen" --output-dir wheelhouse | |
| - name: "Build eudsl-llvmpy" | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| if [[ "${{ matrix.os }}" == "ubuntu" ]]; then | |
| export CCACHE_DIR=/host/$CCACHE_DIR | |
| export CC=clang | |
| export CXX=clang++ | |
| fi | |
| $python3_command -m cibuildwheel "$PWD/projects/eudsl-llvmpy" --output-dir wheelhouse | |
| else | |
| export CMAKE_PREFIX_PATH=$PWD/llvm-install | |
| export PIP_FIND_LINKS=$PWD/wheelhouse | |
| $python3_command -m pip install eudsl-tblgen -f wheelhouse | |
| $python3_command -m pip wheel "$PWD/projects/eudsl-llvmpy" -w wheelhouse -v --no-build-isolation | |
| fi | |
| - name: "Build eudsl-nbgen" | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| if [[ "${{ matrix.os }}" == "ubuntu" ]]; then | |
| export CCACHE_DIR=/host/$CCACHE_DIR | |
| export CC=clang | |
| export CXX=clang++ | |
| fi | |
| $python3_command -m cibuildwheel "$PWD/projects/eudsl-nbgen" --output-dir wheelhouse | |
| else | |
| export CMAKE_PREFIX_PATH=$PWD/llvm-install | |
| export PIP_FIND_LINKS=$PWD/wheelhouse | |
| $python3_command -m pip wheel "$PWD/projects/eudsl-nbgen" -w wheelhouse -v --no-build-isolation | |
| fi | |
| - name: "Build eudsl-py" | |
| if: (!startsWith(matrix.os, 'windows') && github.event_name != 'workflow_dispatch') | |
| run: | | |
| export CMAKE_PREFIX_PATH=$PWD/llvm-install | |
| export PIP_FIND_LINKS=$PWD/wheelhouse | |
| $python3_command -m pip install pytest eudsl-nbgen -f wheelhouse | |
| $python3_command -m pip install "$PWD/projects/eudsl-py" -v --no-build-isolation | |
| $python3_command -m pytest -rA --capture=tee-sys "$PWD/projects/eudsl-py/tests" | |
| # just to/make sure total build continues to work | |
| - name: "Build all of eudsl" | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| $python3_command -m pip install eudsl-tblgen -f wheelhouse | |
| cmake -B $PWD/eudsl-build -S $PWD \ | |
| -DCMAKE_PREFIX_PATH=$PWD/llvm-install \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=$PWD/eudsl-install \ | |
| -DPython3_EXECUTABLE=$(which $python3_command) | |
| cmake --build "$PWD/eudsl-build" --target install | |
| - name: "Save cache" | |
| uses: actions/cache/save@v3 | |
| if: (!cancelled() && github.event_name == 'push' && github.ref_name == 'main') | |
| with: | |
| path: ${{ steps.setup_base.outputs.cache-dir }} | |
| key: ${{ env.cache-key }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: eudsl_${{ matrix.name }}_artifact | |
| path: wheelhouse/*.whl | |
| if-no-files-found: warn | |
| - name: Upload ccache log | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: eudsl_ccache_log_${{ matrix.name }} | |
| path: ${{ startsWith(matrix.os, 'windows') && 'D:\a\ccache.log' || '/tmp/ccache.log' }} | |
| if-no-files-found: ignore | |
| - name: "Setup tmate session" | |
| if: (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate | |
| uses: mxschmitt/action-tmate@v3.18 | |
| with: | |
| limit-access-to-actor: true | |
| install-dependencies: ${{ startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows') || startsWith(matrix.os, 'ubuntu') }} | |
| test-eudsl-tblgen: | |
| if: github.event_name == 'pull_request' | |
| needs: [build-eudsl] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runs-on: ["ubuntu-22.04", "ubuntu-22.04-arm", | |
| "macos-14", "windows-2022"] | |
| python-version: [ | |
| "3.10", "3.11", "3.12", | |
| "3.13", "3.14", "3.14t" | |
| ] | |
| include: [ | |
| {runs-on: "ubuntu-22.04", name: "ubuntu_x86_64", os: "ubuntu"}, | |
| {runs-on: "ubuntu-22.04-arm", name: "ubuntu_aarch64", os: "ubuntu"}, | |
| {runs-on: "windows-2022", name: "windows_amd64", os: "windows"}, | |
| {runs-on: "macos-14", name: "macos_arm64", os: "macos"}, | |
| ] | |
| exclude: | |
| - runs-on: macos-14 | |
| python-version: "3.10" | |
| - runs-on: macos-14 | |
| python-version: "3.11" | |
| - runs-on: macos-14 | |
| python-version: "3.12" | |
| - runs-on: macos-14 | |
| python-version: "3.13" | |
| - runs-on: macos-14 | |
| python-version: "3.14" | |
| runs-on: ${{ matrix.runs-on }} | |
| name: "Test tblgen ${{ matrix.name }} ${{ matrix.python-version }}" | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: "Check out repository" | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| submodules: false | |
| - name: "Install Python" | |
| uses: actions/setup-python@v6.0.0 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: eudsl_${{ matrix.name }}_artifact | |
| path: wheelhouse | |
| - name: "Install eudsl-tblgen" | |
| run: | | |
| python -m pip install pytest | |
| python -m pip install eudsl-tblgen -f wheelhouse | |
| - name: "Test eudsl-tblgen" | |
| run: | | |
| export TESTS_DIR="$PWD/projects/eudsl-tblgen/tests" | |
| if [ ${{ matrix.os }} == 'windows' ]; then | |
| python -m pytest -s -rA $TESTS_DIR | |
| else | |
| python -m pytest -rA --capture=tee-sys $TESTS_DIR | |
| fi | |
| test-eudsl-llvmpy: | |
| if: github.event_name == 'pull_request' | |
| needs: [build-eudsl] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runs-on: [ | |
| "ubuntu-22.04", | |
| "ubuntu-22.04-arm", | |
| "macos-14", | |
| "windows-2022" | |
| ] | |
| python-version: [ | |
| # we only build 3.12 and up | |
| # "3.10", "3.11", | |
| "3.12", "3.13", "3.14", | |
| # stable abi doesn't support 3.14t? | |
| # "3.14t" | |
| ] | |
| include: [ | |
| {runs-on: "ubuntu-22.04", name: "ubuntu_x86_64", os: "ubuntu"}, | |
| {runs-on: "ubuntu-22.04-arm", name: "ubuntu_aarch64", os: "ubuntu"}, | |
| {runs-on: "windows-2022", name: "windows_amd64", os: "windows"}, | |
| {runs-on: "macos-14", name: "macos_arm64", os: "macos"}, | |
| ] | |
| exclude: | |
| - runs-on: macos-14 | |
| python-version: "3.10" | |
| - runs-on: macos-14 | |
| python-version: "3.11" | |
| - runs-on: macos-14 | |
| python-version: "3.12" | |
| - runs-on: macos-14 | |
| python-version: "3.13" | |
| runs-on: ${{ matrix.runs-on }} | |
| name: "Test llvmpy ${{ matrix.name }} ${{ matrix.python-version }}" | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: "Check out repository" | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| submodules: false | |
| - name: "Install Python" | |
| uses: actions/setup-python@v6.0.0 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: eudsl_${{ matrix.name }}_artifact | |
| path: wheelhouse | |
| - name: "Install eudsl-llvmpy" | |
| run: | | |
| python -m pip install pytest | |
| python -m pip install eudsl-llvmpy eudsl-tblgen -f wheelhouse | |
| - name: "Test eudsl-llvmpy" | |
| run: | | |
| export TESTS_DIR="$PWD/projects/eudsl-llvmpy/tests" | |
| python -m pytest -rA --capture=tee-sys $TESTS_DIR | |
| release-eudsl: | |
| if: (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'workflow_dispatch' | |
| needs: [build-eudsl] | |
| runs-on: "ubuntu-22.04" | |
| permissions: | |
| id-token: write | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: [ | |
| "ubuntu_x86_64", | |
| "ubuntu_aarch64", | |
| "macos_arm64", | |
| # "macos_x86_64", | |
| "windows_amd64" | |
| ] | |
| name: "Release eudsl ${{ matrix.name }}" | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: eudsl_${{ matrix.name }}_artifact | |
| path: wheelhouse | |
| - name: Release current commit | |
| uses: ncipollo/release-action@v1.12.0 | |
| with: | |
| artifacts: "wheelhouse/eudsl*.whl" | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| tag: ${{ github.ref_name == 'main' && 'eudsl' || 'dev' }} | |
| name: ${{ github.ref_name == 'main' && 'eudsl' || 'dev' }} | |
| removeArtifacts: false | |
| allowUpdates: true | |
| replacesArtifacts: true | |
| makeLatest: true | |
| omitBody: true | |
| call-deploy-pip-page: | |
| if: (github.event_name == 'push' && github.ref_name == 'main') | |
| needs: [release-eudsl] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pages: write | |
| uses: ./.github/workflows/deploy_pip_page.yml | |
| secrets: inherit # pass all secrets |