This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
ci: support Cairo1 recompile in CI #1261
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify Cairo File Dependencies | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v[0-9].** | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- 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: | |
# 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' | |
- uses: actions-rs/toolchain@master | |
with: | |
components: rustfmt | |
toolchain: nightly-2024-01-12 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- run: | |
cd blockifier && | |
pip install -r crates/blockifier/tests/requirements.txt && | |
cargo test verify_feature_contracts -- --include-ignored | |
- name: checkout legacy tag of cairo1 repo in order to compile the legacy contract. | |
uses: actions/checkout@v4 | |
with: | |
repository: 'starkware-libs/cairo' | |
fetch-tags: tags | |
ref: ${{ env.LEGACY_TAG }} | |
path: 'cairo' | |
- name: Verify the legacy contract. | |
uses: actions-rs/toolchain@master | |
with: | |
components: rustfmt | |
toolchain: nightly-2024-01-12 | |
- uses: Swatinem/rust-cache@v2 | |
- run: | |
cd blockifier && | |
LEGACY=1 cargo test verify_feature_contracts -- --include-ignored |