Skip to content

âš¡ Select assertion-free LLVM SDKs (Phase 1) #672

âš¡ Select assertion-free LLVM SDKs (Phase 1)

âš¡ Select assertion-free LLVM SDKs (Phase 1) #672

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test-installer-scripts:
name: Installer ${{ matrix.version }} (assertions=${{ matrix.assertions }}) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
ubuntu-26.04,
ubuntu-26.04-arm,
macos-26,
windows-2025,
windows-11-arm,
]
version: ["21.1.8", "22.1.0", "f8cb798", "23.1.2"]
assertions: ["ON", "OFF"]
exclude:
- version: "21.1.8"
assertions: "OFF"
- version: "22.1.0"
assertions: "OFF"
- version: "f8cb798"
assertions: "OFF"
env:
SETUP_MLIR_MANIFEST_URL: https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name || github.repository }}/${{ github.event.pull_request.head.sha || github.sha }}/version-manifest.json
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Test installer script (Bash)
if: runner.os != 'Windows'
shell: bash
run: |
installation/setup-mlir.sh -v ${{ matrix.version }} -p /tmp/mlir-install -a ${{ matrix.assertions }}
grep -F "set(LLVM_ENABLE_ASSERTIONS ${{ matrix.assertions }})" /tmp/mlir-install/lib/cmake/llvm/LLVMConfig.cmake
# Verify installation
if [ ! -d "/tmp/mlir-install/bin" ]; then
echo "Error: bin directory not found"
exit 1
fi
if [ ! -d "/tmp/mlir-install/lib/cmake/llvm" ]; then
echo "Error: LLVM cmake directory not found"
exit 1
fi
if [ ! -d "/tmp/mlir-install/lib/cmake/mlir" ]; then
echo "Error: MLIR cmake directory not found"
exit 1
fi
# Verify binaries exist
export PATH="/tmp/mlir-install/bin:$PATH"
if ! command -v mlir-opt &> /dev/null; then
echo "Error: mlir-opt not found in PATH"
exit 1
fi
# Test that mlir-opt runs
mlir-opt --version
echo "Installation test passed!"
- name: Test installer script (PowerShell)
if: runner.os == 'Windows'
shell: pwsh
run: |
$install_dir = Join-Path $env:TEMP "mlir-install"
& installation/setup-mlir.ps1 -llvm_version ${{ matrix.version }} -install_prefix $install_dir -no_assertions:('${{ matrix.assertions }}' -eq 'OFF')
if (-not (Select-String -Path "$install_dir/lib/cmake/llvm/LLVMConfig.cmake" -SimpleMatch "set(LLVM_ENABLE_ASSERTIONS ${{ matrix.assertions }})")) {
throw "Installed LLVM assertion mode does not match"
}
# Verify installation
if (-not (Test-Path "$install_dir\bin")) {
Write-Error "bin directory not found"
exit 1
}
if (-not (Test-Path "$install_dir\lib\cmake\llvm")) {
Write-Error "LLVM cmake directory not found"
exit 1
}
if (-not (Test-Path "$install_dir\lib\cmake\mlir")) {
Write-Error "MLIR cmake directory not found"
exit 1
}
# Verify binaries exist
$env:Path = "$install_dir\bin;$env:Path"
if (-not (Get-Command mlir-opt -ErrorAction SilentlyContinue)) {
Write-Error "mlir-opt not found in PATH"
exit 1
}
# Test that mlir-opt runs
mlir-opt --version
Write-Host "Installation test passed!"
integration-tests:
name: Integration tests with coverage on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
os:
[
ubuntu-26.04,
ubuntu-26.04-arm,
macos-26,
windows-2025,
windows-11-arm,
]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Run integration tests with coverage
env:
GITHUB_TOKEN: ${{ github.token }}
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
files: ./coverage/lcov.info
flags: integration-${{ matrix.os }}
name: integration-${{ matrix.os }}
use_oidc: true
# This job does nothing and is only used for branch protection
required-checks-pass:
name: 🚦 Check
if: always()
needs:
- test-installer-scripts
- integration-tests
runs-on: ubuntu-slim
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
with:
jobs: ${{ toJSON(needs) }}