Remove print helpers #14112
Workflow file for this run
This file contains hidden or 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: CI | |
env: | |
DEVNET_REV: 26292d1f92807090776b470f43b321f150f55ffd # v0.4.1 | |
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix_os: ${{ steps.set-matrix.outputs.matrix_os }} | |
steps: | |
- name: Set OS matrix based on event | |
id: set-matrix | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
echo 'matrix_os=["ubuntu-latest"]' >> $GITHUB_OUTPUT | |
else | |
echo 'matrix_os=["ubuntu-latest","windows-latest"]' >> $GITHUB_OUTPUT | |
fi | |
test-forge-unit: | |
needs: setup | |
name: Test Forge / Unit Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ${{ fromJson(needs.setup.outputs.matrix_os) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- run: cargo test --release --lib -p forge | |
# TODO(#3096): Remove running tests with `scarb_since_2_10` | |
- uses: software-mansion/setup-scarb@v1 | |
with: | |
scarb-version: "2.10.1" | |
- name: Check and lint forge templates | |
run: cargo test --release -p forge --features scarb_since_2_10 validate_templates | |
- name: Check and lint snforge_std | |
run: cargo test --release -p forge --features scarb_since_2_10 validate_snforge_std | |
build-test-forge-nextest-archive: | |
needs: setup | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ${{ fromJson(needs.setup.outputs.matrix_os) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Build and archive tests | |
run: cargo nextest archive --release -p forge --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' | |
- name: Upload archive to workflow | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nextest-archive-${{ matrix.os }} | |
path: nextest-archive-${{ matrix.os }}.tar.zst | |
test-forge-integration: | |
name: Test Forge / Integration Tests | |
runs-on: ${{ matrix.os }} | |
needs: [ build-test-forge-nextest-archive, setup ] | |
strategy: | |
fail-fast: false | |
matrix: | |
partition: [ 1, 2, 3 ] | |
os: ${{ fromJson(needs.setup.outputs.matrix_os) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- uses: taiki-e/install-action@nextest | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nextest-archive-${{ matrix.os }} | |
- name: nextest partition ${{ matrix.partition }}/3 | |
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' integration | |
test-forge-e2e: | |
name: Test Forge / E2E Tests | |
runs-on: ${{ matrix.os }} | |
needs: [ build-test-forge-nextest-archive, setup ] | |
strategy: | |
fail-fast: false | |
matrix: | |
partition: [ 1, 2, 3 ] | |
os: ${{ fromJson(needs.setup.outputs.matrix_os) }} | |
steps: | |
- name: Extract branch name | |
if: github.event_name != 'pull_request' | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | |
shell: bash | |
- name: Extract branch name on pull request | |
if: github.event_name == 'pull_request' | |
run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV | |
shell: bash | |
- name: Extract repo name and owner | |
if: github.event_name != 'pull_request' | |
run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV | |
shell: bash | |
- name: Extract repo name and owner on pull request | |
if: github.event_name == 'pull_request' | |
run: echo "REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)" >> $GITHUB_ENV | |
shell: bash | |
- name: Install cairo-profiler | |
if: runner.os != 'Windows' | |
run: | | |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh | |
- name: Install cairo-coverage | |
if: runner.os != 'Windows' | |
run: | | |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- uses: taiki-e/install-action@nextest | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nextest-archive-${{ matrix.os }} | |
- name: nextest partition ${{ matrix.partition }}/3 | |
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' e2e | |
test-requirements-check-special-conditions: | |
name: Test requirements check special conditions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- run: cargo test --package forge --features no_scarb_installed --lib compatibility_check::tests::failing_tool_not_installed | |
- uses: software-mansion/setup-scarb@v1 | |
with: | |
scarb-version: "2.9.1" | |
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::requirements::test_warning_on_scarb_version_below_recommended | |
- run: cargo test --package forge --features scarb_2_9_1 --lib compatibility_check::tests::warning_requirements | |
- run: cargo test --package forge --features scarb_2_9_1 --test main e2e::running::sierra_gas_with_older_scarb | |
# todo(3096): Remove this and the feature as soon as scarb 2.10 is the oldest officially supported version | |
test-scarb-since-2-10: | |
name: Test scarb 2.10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
with: | |
scarb-version: "2.10.1" | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- run: cargo test --package forge --features scarb_since_2_10 sierra_gas | |
test-forge-runner: | |
name: Test Forge Runner | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- run: cargo test --release -p forge_runner | |
test-cheatnet: | |
name: Test Cheatnet | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- name: Run Cheatnet tests | |
run: cargo test --release -p cheatnet | |
test-data-transformer: | |
name: Test Data Transformer | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- name: Run Data Transformer tests | |
run: cargo test --release -p data-transformer | |
test-forge-debugging: | |
name: Test Forge Debugging | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8 | |
- uses: software-mansion/setup-scarb@22f50f68eb6ffacfc173786dab19aa7d49b43441 # v1.5.0 | |
- uses: software-mansion/setup-universal-sierra-compiler@58146c4184fa6ec5e8aaf02309ab85e35f782ed0 # v1.0.0 | |
- name: Run Forge Debugging tests | |
run: cargo test --release -p forge --features debugging --test main e2e::debugging | |
test-forge-backtrace: | |
name: Test Forge Backtrace - support for `panic-backtrace` in Scarb.toml | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8 | |
- uses: software-mansion/setup-scarb@22f50f68eb6ffacfc173786dab19aa7d49b43441 # v1.5.0 | |
with: | |
scarb-version: "nightly-2025-03-27" | |
- uses: software-mansion/setup-universal-sierra-compiler@58146c4184fa6ec5e8aaf02309ab85e35f782ed0 # v1.0.0 | |
- name: Run Forge Debugging tests | |
run: cargo test --release -p forge --features supports-panic-backtrace --test main e2e::backtrace | |
test-forge-scarb-plugin: | |
name: Test Forge Scarb Plugin | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- name: Run Forge Scarb Plugin tests | |
working-directory: crates/snforge-scarb-plugin | |
run: cargo test --release | |
test-cast: | |
name: Test Cast | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# TODO(#3083): Restore running sncast tests on Windows | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- name: Install starknet-devnet-rs on Linux/Macos | |
if: runner.os != 'Windows' | |
run: | | |
./scripts/install_devnet.sh | |
- name: Cache devnet build | |
if: runner.os == 'Windows' | |
id: windows-devnet-cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}\crates\sncast\tests\utils\devnet | |
key: ${{ runner.os }}-devnet-${{ env.DEVNET_REV }} | |
- name: Install devnet | |
if: runner.os == 'Windows' && steps.windows-devnet-cache.outputs.cache-hit != 'true' | |
run: | | |
$DEVNET_INSTALL_DIR = "${{ github.workspace }}\crates\sncast\tests\utils\devnet" | |
cargo install --git https://github.com/0xSpaceShard/starknet-devnet-rs.git --locked --rev ${{ env.DEVNET_REV }} --root $DEVNET_INSTALL_DIR | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- name: Run tests | |
run: cargo test --release -p sncast | |
# TODO(#3096): Remove running tests with `scarb_since_2_10` | |
- uses: software-mansion/setup-scarb@v1 | |
with: | |
scarb-version: "2.10.1" | |
- name: Check and lint sncast_std | |
run: cargo test --release -p sncast --features scarb_since_2_10 validate_sncast_std | |
test-conversions: | |
name: Test Conversions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- name: Run tests | |
run: cargo test --release -p conversions | |
test-shared: | |
name: Test Shared | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- run: cargo test --release -p shared | |
test-scarb-api: | |
needs: setup | |
name: Test Scarb Api | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ${{ fromJson(needs.setup.outputs.matrix_os) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- run: cargo test --release -p scarb-api | |
scarbfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: software-mansion/setup-scarb@v1 | |
- name: Check cairo files format | |
run: | | |
output=$(find . -type f -name "Scarb.toml" -execdir sh -c ' | |
echo "Running \"scarb fmt\" in directory: $PWD" | |
scarb fmt --check | |
' \;) | |
echo "$output" | |
if grep -iq "Diff" <<< "$output"; then | |
exit 1 | |
fi | |
exit 0 | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- name: Check formatting | |
run: cargo fmt --check | |
clippy: | |
runs-on: ubuntu-latest | |
env: | |
# Make sure CI fails on all warnings - including Clippy lints. | |
RUSTFLAGS: "-Dwarnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- run: cargo lint | |
build-docs: | |
name: Test Building Docs | |
runs-on: ubuntu-latest | |
env: | |
MDBOOK_VERSION: 0.4.31 | |
steps: | |
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 | |
- uses: actions/checkout@v4 | |
- uses: software-mansion/setup-scarb@v1 | |
- uses: software-mansion/setup-universal-sierra-compiler@v1 | |
- name: Install mdBook | |
run: | | |
cargo install --version ${MDBOOK_VERSION} mdbook | |
- name: Install mdBook Link-Check | |
run: | | |
cargo install mdbook-linkcheck | |
- name: Build with mdBook | |
run: | | |
# TODO(#2781): Use `mdbook build` | |
./scripts/build_docs.sh | |
- name: Install Forge | |
run: | | |
cargo install --path crates/forge --locked | |
- name: Verify Cairo listings | |
run: | | |
./scripts/verify_cairo_listings.sh | |
typos: | |
name: Check typos | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: typos-action | |
uses: crate-ci/[email protected] |