Upgrade to new LLVM pass manager #513
Workflow file for this run
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
pull_request: | |
branches: | |
- main | |
- release/* | |
- feature/* | |
workflow_dispatch: | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
fmt: | |
name: Code Style | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14.0" | |
- name: Setup rust toolchain | |
run: rustup show | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo fmt | |
run: cargo fmt -v --all -- --check | |
- name: cargo clippy | |
run: cargo clippy -vv --all-targets -- -D warnings | |
- name: cargo doc | |
run: cargo doc -vv --all --no-deps | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install Python packages | |
run: | | |
python -m pip install -U pip | |
python -m pip install -r pip/requirements-dev.txt | |
- name: Python formatting | |
run: python -m black --check pip | |
- name: Publish Docs as Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: docs | |
path: target/doc | |
benches: | |
name: Benches | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14.0" | |
- name: Setup rust toolchain | |
run: rustup show | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo bench | |
run: cargo bench --workspace | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14.0" | |
- name: Setup rust toolchain | |
run: rustup show | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build -vv --release | |
- name: Test | |
run: cargo test -vv --release -- --nocapture | |
nightly: | |
name: Build Nightly | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "14.0" | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
override: true | |
components: rustfmt, clippy, llvm-tools-preview | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build Nightly | |
run: cargo build -vv --release | |
- name: Test Nightly | |
run: cargo test -vv --release -- --nocapture | |
release: | |
name: Release | |
runs-on: ${{ matrix.config.os }} | |
env: ${{ matrix.config.env }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { os: "ubuntu-20.04", arch: "amd64", env: { AUDITWHEEL_TAG: "manylinux_2_31_x86_64" } } | |
- { os: "ubuntu-22.04", arch: "amd64", env: { AUDITWHEEL_TAG: "manylinux_2_35_x86_64" } } | |
- { os: "windows-2019", arch: "amd64", env: {} } | |
- { os: "macos-11", arch: "amd64", env: { MACOSX_DEPLOYMENT_TARGET: 10.9 } } | |
- { os: "macos-14", arch: "arm64", env: {} } | |
- { os: "macos-14", arch: "universal", env: { ARCHFLAGS: "-arch arm64 -arch x86_64" } } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup rust toolchain | |
run: rustup show | |
- shell: pwsh | |
run: | | |
rustup target add x86_64-apple-darwin | |
if: ${{ (matrix.config.os == 'macos-14') && (matrix.config.arch == 'universal') }} | |
- name: Install LLVM | |
uses: ./.github/actions/install-llvm | |
with: | |
version: "14" | |
os: ${{ matrix.config.os }} | |
directory: ${{ github.workspace }}/target/llvm | |
arch: ${{ matrix.config.arch }} | |
- name: Build | |
run: cargo build -vv --release | |
- name: Test | |
run: cargo test -vv --release -- --nocapture | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
if: ${{ matrix.config.os != 'macos-14' }} | |
- name: Install Unconditional Python packages | |
run: | | |
python -m pip install -U pip | |
python -m pip install -r pip/requirements.txt | |
- name: Install Auditwheel Python packages for Linux | |
run: | | |
python -m pip install -r pip/requirements-manylinux.txt | |
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }} | |
- name: Package Non-Linux | |
run: python -m pip --verbose wheel --verbose --wheel-dir target/wheels ./pip | |
if: ${{ matrix.config.os != 'ubuntu-20.04' && matrix.config.os != 'ubuntu-22.04' }} | |
- name: Package Linux | |
run: python -m pip --verbose wheel --verbose --wheel-dir target/raw-wheels ./pip | |
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }} | |
- name: Auditwheel | |
run: auditwheel repair --plat $AUDITWHEEL_TAG --wheel-dir target/wheels target/raw-wheels/*.whl | |
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }} | |
- name: Test Wheel | |
run: | | |
python -m pip install -r pip/requirements-test.txt | |
python -m pip install --force-reinstall --no-index --find-links=target/wheels qirrunner | |
python -m pytest --verbose pip | |
if: ${{ matrix.config.os == 'ubuntu-20.04' || matrix.config.os == 'ubuntu-22.04' }} | |
# qir-stdlib Artifact | |
- name: qir-stdlib Artifact (Library) | |
if: ${{ matrix.config.os != 'windows-2019' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: target/release/libqir_stdlib.a | |
- name: qir-stdlib Artifact (Library on Windows) | |
if: ${{ matrix.config.os == 'windows-2019' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: target/release/qir_stdlib.lib | |
- name: qir-stdlib Artifact (Definition file) | |
if: ${{ matrix.config.os == 'windows-2019' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: stdlib/include/qir_stdlib.def | |
- name: qir-stdlib Artifact (Header file) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: stdlib/include/qir_stdlib.h | |
- name: qir-stdlib Artifact (Notice file) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: runner/NOTICE.txt | |
- name: qir-stdlib Artifact (License file) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-stdlib-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: LICENSE | |
# qir-runner Artifact | |
- name: Artifacts executable | |
if: ${{ matrix.config.os != 'windows-2019' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: target/release/qir-runner | |
- name: Artifacts executable (Windows) | |
if: ${{ matrix.config.os == 'windows-2019' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: target/release/qir-runner.exe | |
- name: Artifacts Notice file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: runner/NOTICE.txt | |
- name: Artifacts License file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qir-runner-${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts | |
path: LICENSE | |
- name: Wheel Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-artifacts-${{ matrix.config.os }}-${{ matrix.config.arch }} | |
path: target/wheels/* | |
merge: | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Merge Wheel Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: wheels | |
pattern: wheel-artifacts-* | |
docs: | |
runs-on: "ubuntu-22.04" | |
needs: fmt | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: docs | |
path: target/doc | |
- name: Index Page Redirection | |
run: echo '<meta http-equiv="refresh" content="0; url=qir_runner">' > target/doc/index.html | |
- name: Publish Docs to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@4.1.7 | |
with: | |
branch: gh-pages | |
folder: target/doc | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' |