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

Commit

Permalink
ci: support Cairo1 recompile in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <[email protected]>
  • Loading branch information
dorimedini-starkware committed May 7, 2024
1 parent de67951 commit f54a069
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,44 @@ on:
- synchronize
paths:
- 'crates/blockifier/feature_contracts/cairo0/**'
- 'crates/blockifier/feature_contracts/cairo1/**'
- 'crates/blockifier/tests/feature_contracts_compatibility_test.rs'

jobs:
verify_cairo_file_dependencies:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
# Checkout blockifier into a dedicated directory - technical requirement in order to be able to checkout `cairo` in a sibling directory.
- name: checkout blockifier into `blockifier` directory.
uses: actions/checkout@v4
with:
repository: 'starkware-libs/blockifier'
path: 'blockifier'

- name: Read Cairo1 Tag to compile contracts with from Blockifier.
id: read-tag
# GITHUB_ENV is a variable github allocates for dynamic stuff inside workflow like our usage, name not customizable.
run: echo "TAG=$(cat blockifier/crates/blockifier/tests/cairo1_compiler_tag.txt)" >> $GITHUB_ENV

- name: checkout cairo1 repo in order to compile cairo1 contracts.
uses: actions/checkout@v4
with:
repository: 'starkware-libs/cairo'
fetch-tags: tags
ref: ${{ env.TAG }}
path: 'cairo'

- uses: actions-rs/toolchain@master
with:
components: rustfmt
toolchain: nightly-2024-01-12
toolchain: nightly-2023-07-05
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- run:
pip install -r crates/blockifier/tests/requirements.txt;
cd blockifier &&
pip install -r crates/blockifier/tests/requirements.txt &&
cargo test verify_feature_contracts -- --include-ignored
1 change: 0 additions & 1 deletion crates/blockifier/src/test_utils/cairo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ fn verify_cairo1_compiler_deps(git_tag_override: Option<String>) {
// Checkout the required version in the compiler repo.
run_and_verify_output(Command::new("git").args([
"-C",
// TODO(Dori, 1/6/2024): Handle CI case (repo path will be different).
cairo_repo_path.to_str().unwrap(),
"checkout",
&tag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ fn verify_feature_contracts_match_enum() {
fn verify_feature_contracts(
#[values(CairoVersion::Cairo0, CairoVersion::Cairo1)] cairo_version: CairoVersion,
) {
if std::env::var("CI").is_ok() && matches!(cairo_version, CairoVersion::Cairo1) {
// TODO(Dori, 1/6/2024): Support Cairo1 contracts in the CI and remove this `if` statement.
return;
}
let fix_features = std::env::var("FIX_FEATURE_TEST").is_ok();
verify_feature_contracts_compatibility(fix_features, cairo_version)
}

0 comments on commit f54a069

Please sign in to comment.