-
Notifications
You must be signed in to change notification settings - Fork 108
ci: support Cairo1 recompile in CI #1877
base: dori/add-cairo1-version-file-for-ci
Are you sure you want to change the base?
ci: support Cairo1 recompile in CI #1877
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dori/add-cairo1-version-file-for-ci #1877 +/- ##
=======================================================================
- Coverage 76.48% 76.47% -0.01%
=======================================================================
Files 61 61
Lines 8770 8771 +1
Branches 8770 8771 +1
=======================================================================
Hits 6708 6708
- Misses 1622 1623 +1
Partials 440 440 ☔ View full report in Codecov by Sentry. |
4bdb6bc
to
3ce1e84
Compare
0d4274f
to
de67951
Compare
0999c4d
to
f54a069
Compare
de67951
to
103ae1b
Compare
b3c1d93
to
7c929a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 19 files reviewed, all discussions resolved (waiting on @dorimedini-starkware)
.github/workflows/compiled_cairo.yml
line 1 at r2 (raw file):
name: Verify Cairo File Dependencies
this was a mistake before, IIUC. now the workflows area doesn't show CI
twice
Code quote:
Verify Cairo File Dependencies
7952832
to
22d2764
Compare
22d2764
to
e34a403
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 17 of 19 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @OriStarkware and @Yoni-Starkware)
.github/workflows/compiled_cairo.yml
line 1 at r2 (raw file):
Previously, dorimedini-starkware wrote…
this was a mistake before, IIUC. now the workflows area doesn't show
CI
twice
OMG THANK YOU!
This was so annoying.
.github/workflows/compiled_cairo.yml
line 48 at r3 (raw file):
fetch-tags: tags ref: ${{ env.TAG }} path: 'cairo'
Do we want to add - uses: Swatinem/rust-cache@v2
to these entries?
Might save the cloning time, though it's probably negligible since this isn't run too often.
Code quote:
# 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: Read legacy Cairo1 Tag to compile the legacy contract with.
id: read-legacy-tag
# GITHUB_ENV is a variable github allocates for dynamic stuff inside workflow like our usage, name not customizable.
run: echo "LEGACY_TAG=$(cat blockifier/crates/blockifier/tests/legacy_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'
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 147 at r3 (raw file):
} else { std::env::var("CI").is_err() || !contract.is_legacy() })
Totally optional, only if you feel like it,
Suggestion:
let fix_features = env::var("FIX_FEATURE_TEST").is_ok();
let test_legacy_only = env::var("LEGACY").is_ok();
let not_in_ci = env::var("CI").is_err();
let contracts_to_test = FeatureContract::all_feature_contracts().filter(|contract| {
// If called with LEGACY environment variable set, only test legacy contracts (from CI
// or not).
// If tested from the CI *without* the LEGACY environment variable set, test only
// non-legacy contracts of the respective cairo version.
// If not tested from CI, test all contracts of the requested cairo version.
contract.cairo_version() == cairo_version
&& (if test_legacy_only {
contract.is_legacy()
} else {
not_in_ci || !contract.is_legacy()
})
979d669
to
68f63b9
Compare
Signed-off-by: Dori Medini <[email protected]>
68f63b9
to
cf07a5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @OriStarkware and @Yoni-Starkware)
crates/blockifier/tests/feature_contracts_compatibility_test.rs
line 147 at r3 (raw file):
Previously, giladchase wrote…
Totally optional, only if you feel like it,
🔥
dojo-core: update gas logs Co-authored-by: glihm <[email protected]>
This change is