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

ci: support Cairo1 recompile in CI #1255

ci: support Cairo1 recompile in CI

ci: support Cairo1 recompile in CI #1255

name: CI
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-tag

Check failure on line 38 in .github/workflows/compiled_cairo.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/compiled_cairo.yml (Line: 38, Col: 13): The identifier 'read-tag' may not be used more than once within the same scope.
# 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-2023-07-05
- 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-2023-07-05
- uses: Swatinem/rust-cache@v2
- run:
cd blockifier &&
LEGACY=1 cargo test verify_feature_contracts -- --include-ignored