diff --git a/.github/workflows/test.yml b/.github/workflows/native-tests.yml similarity index 82% rename from .github/workflows/test.yml rename to .github/workflows/native-tests.yml index e32a68edd..478408e05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/native-tests.yml @@ -1,4 +1,4 @@ -name: Install dependencies, build the project and run tests from zero +name: Test Cairo Native Integration on: merge_group: @@ -48,24 +48,16 @@ jobs: id: deps run: make deps${{ matrix.deps_suffix }} - - name: Run make build - id: build - run: make build - - - name: Run make test - id: test - env: - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} + - name: Run make test-cairo-native + id: test-cairo-native run: | . starknet-venv/bin/activate; \ - make test + make test-cairo-native - name: Check which step failed if: failure() run: | if [ ${{ steps.deps.outcome }} = failure ]; then FAILED_TARGET=deps${{ matrix.deps_suffix }} - elif [ ${{ steps.build.outcome }} = failure ]; then - FAILED_TARGET=build else FAILED_TARGET=test fi diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index 2b6be1b73..fb3b5b0e5 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -1,4 +1,4 @@ -name: rust-tests +bianename: rust-tests on: merge_group: @@ -32,9 +32,7 @@ jobs: compile-cairo-2-sierra, ] name: Build Cairo programs - runs-on: debian-12 - env: - MLIR_SYS_160_PREFIX: /usr/lib/llvm-16/ + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -73,7 +71,7 @@ jobs: # TODO: remove this cache once the workflow finishes merge-caches: name: Merge Cairo programs cache - runs-on: debian-12 + runs-on: ubuntu-22.04 needs: build-programs steps: - name: Checkout @@ -138,9 +136,7 @@ jobs: build: name: Build with release profile needs: merge-caches - runs-on: debian-12 - env: - MLIR_SYS_160_PREFIX: /usr/lib/llvm-16/ + runs-on: ubuntu-22.04 steps: - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -150,14 +146,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - name: add llvm deb repository - uses: myci-actions/add-deb-repo@10 - with: - repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main - repo-name: llvm-repo - keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - - name: Install LLVM - run: sudo apt-get install llvm-16 llvm-16-dev llvm-16-runtime clang-16 clang-tools-16 lld-16 libpolly-16-dev libmlir-16-dev mlir-16-tools - name: Checkout uses: actions/checkout@v3 - name: Fetch programs @@ -173,9 +161,7 @@ jobs: lint: name: Lint with fmt and clippy needs: merge-caches - runs-on: debian-12 - env: - MLIR_SYS_160_PREFIX: /usr/lib/llvm-16/ + runs-on: ubuntu-22.04 steps: - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -185,14 +171,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - name: add llvm deb repository - uses: myci-actions/add-deb-repo@10 - with: - repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main - repo-name: llvm-repo - keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - - name: Install LLVM - run: sudo apt-get install llvm-16 llvm-16-dev llvm-16-runtime clang-16 clang-tools-16 lld-16 libpolly-16-dev libmlir-16-dev mlir-16-tools - name: Checkout uses: actions/checkout@v3 - name: Fetch programs @@ -210,14 +188,13 @@ jobs: tests: env: INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} - MLIR_SYS_160_PREFIX: /usr/lib/llvm-16/ strategy: fail-fast: false matrix: target: [ test-cairo-1, test-cairo-2, test-doctests ] name: Run tests needs: merge-caches - runs-on: debian-12 + runs-on: ubuntu-22.04 steps: - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -227,14 +204,6 @@ jobs: - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - - name: add llvm deb repository - uses: myci-actions/add-deb-repo@10 - with: - repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main - repo-name: llvm-repo - keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - - name: Install LLVM - run: sudo apt-get install llvm-16 llvm-16-dev llvm-16-runtime clang-16 clang-tools-16 lld-16 libpolly-16-dev libmlir-16-dev mlir-16-tools - name: Checkout uses: actions/checkout@v3 @@ -258,9 +227,7 @@ jobs: coverage: needs: merge-caches name: Generate and upload coverage report - runs-on: debian-12 - env: - MLIR_SYS_160_PREFIX: /usr/lib/llvm-16/ + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -268,14 +235,6 @@ jobs: uses: dtolnay/rust-toolchain@nightly with: toolchain: ${{ env.RUST_TOOLCHAIN }} - - name: add llvm deb repository - uses: myci-actions/add-deb-repo@10 - with: - repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main - repo-name: llvm-repo - keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key - - name: Install LLVM - run: sudo apt-get install llvm-16 llvm-16-dev llvm-16-runtime clang-16 clang-tools-16 lld-16 libpolly-16-dev libmlir-16-dev mlir-16-tools - name: Set nightly as default run: rustup default nightly diff --git a/Makefile b/Makefile index 3728e9fd5..87c8a67c0 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,10 @@ test-cairo-1: cargo nextest run --workspace --all-targets --features=cairo_1_tests test-cairo-2: - cargo nextest run --workspace --all-targets --features=cairo-native + cargo nextest run --workspace --all-targets + +test-cairo-native: + cargo nextest run --workspace --test cairo_native --features=cairo-native test-doctests: cargo test --workspace --doc