Skip to content

Blocks Running Workflow #3994

Blocks Running Workflow

Blocks Running Workflow #3994

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check:
name: clippy
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Clippy
run: make check
fmt:
name: rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all -- --check
- name: Find Comment
continue-on-error: true
if: success() || failure()
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: thiscommentistofindthisformatcomment
- name: Create or update comment
continue-on-error: true
if: failure()
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
❌ Code is not formatted! Please run `cargo format` and push the changes.
<!-- thiscommentistofindthisformatcomment -->
edit-mode: replace
- name: Create or update comment
continue-on-error: true
if: ${{ success() && steps.fc.outputs.comment-id != null }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
✅ Code is now correctly formatted.
<!-- thiscommentistofindthisformatcomment -->
edit-mode: replace
# Check for unnecessary dependencies.
udeps:
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Machete
uses: bnjbvr/cargo-machete@main
test:
name: test (linux, amd64)
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUST_LOG: cairo_native=debug,cairo_native_test=debug
steps:
- uses: actions/checkout@v4
- name: check and free hdd space left
run: |
echo "Listing 20 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20
df -h
sudo apt-get update
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^temurin-.*'
sudo apt-get remove -y azure-cli microsoft-edge-stable google-chrome-stable firefox mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"
# deleting 15GB
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- run: sudo apt-get update && sudo apt-get upgrade -y
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Install deps
run: make deps
- name: test
run: make test-ci
- name: test-cairo
run: make test-cairo
test_macos:
name: Test (macOS, Apple silicon)
runs-on: macos-14
env:
CARGO_TERM_COLOR: always
LIBRARY_PATH: /opt/homebrew/lib
MLIR_SYS_190_PREFIX: /opt/homebrew/opt/llvm@19
LLVM_SYS_191_PREFIX: /opt/homebrew/opt/llvm@19
TABLEGEN_190_PREFIX: /opt/homebrew/opt/llvm@19
RUST_LOG: cairo_native=debug,cairo_native_test=debug
steps:
- uses: actions/checkout@v4
- name: Rustup toolchain install
uses: dtolnay/[email protected]
with:
components: clippy
- name: Rust `$PATH` workaround.
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: Homebrew/actions/setup-homebrew@master
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
- name: Install deps
run: make deps
- name: Run tests
run: make test-ci
- name: test-cairo
run: make test-cairo
coverage:
name: coverage
runs-on: ubuntu-24.04
strategy:
matrix:
partition: [1, 2, 3, 4]
include:
- partition: 1
output: lcov-1.info
- partition: 2
output: lcov-2.info
- partition: 3
output: lcov-3.info
- partition: 4
output: lcov-4.info
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RUST_LOG: cairo_native=debug
steps:
- uses: actions/checkout@v4
- name: check and free hdd space left
run: |
echo "Listing 20 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20
df -h
sudo apt-get update
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^temurin-.*'
sudo apt-get remove -y azure-cli microsoft-edge-stable google-chrome-stable firefox mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"
# deleting 15GB
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: Install testing tools
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,cargo-llvm-cov
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
- name: Install deps
run: make deps
- name: Build runtime and alexandria
run: make runtime-ci && make check-llvm && make needs-cairo2 && make build-alexandria
- name: Run tests and generate coverage partition ${{ matrix.partition }}
run: cargo llvm-cov nextest --verbose --features=scarb --workspace --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4
- name: test and generate coverage corelib
if: ${{ matrix.partition == '1' }}
run: cargo llvm-cov nextest --verbose --features=scarb --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib
- name: save coverage data with corelib
if: ${{ matrix.partition == '1' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-1
path: |
./${{ matrix.output }}
./lcov-test.info
- name: save coverage data
if: ${{ matrix.partition != '1' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.partition }}
path: ./${{ matrix.output }}
upload-coverage:
name: Upload Coverage
runs-on: ubuntu-24.04
needs: [coverage]
steps:
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependencies
uses: Swatinem/rust-cache@v2
- name: Install testing tools
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,cargo-llvm-cov
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts partition 1
uses: actions/download-artifact@v4
with:
name: coverage-data-1
- name: Download artifacts partition 2
uses: actions/download-artifact@v4
with:
name: coverage-data-2
- name: Download artifacts partition 3
uses: actions/download-artifact@v4
with:
name: coverage-data-3
- name: Download artifacts partition 4
uses: actions/download-artifact@v4
with:
name: coverage-data-4
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Merge the reports
run: lcov -a lcov-1.info -a lcov-2.info -a lcov-3.info -a lcov-4.info -o lcov.info
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.info,./lcov-test.info
fail_ci_if_error: true
verbose: true
dockerfile:
name: dockerfile (linux, amd64)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: check and free hdd space left
run: |
echo "Listing 20 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20
df -h
sudo apt-get update
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^temurin-.*'
sudo apt-get remove -y azure-cli microsoft-edge-stable google-chrome-stable firefox mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"
# deleting 15GB
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/lib/android
df -h
- name: build image
run: docker build .