Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Switch to special workflow for native integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchatruc committed Sep 6, 2023
1 parent 333dc51 commit 76ad108
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 61 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/test.yml → .github/workflows/native-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Install dependencies, build the project and run tests from zero
name: Test Cairo Native Integration

on:
merge_group:
Expand Down Expand Up @@ -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
Expand Down
55 changes: 7 additions & 48 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rust-tests
bianename: rust-tests

on:
merge_group:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -258,24 +227,14 @@ 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
- name: Install Rust
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
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76ad108

Please sign in to comment.