From 78508b9ee5584fce3956911b7877c22fa6d27abf Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 16 Jan 2025 17:01:03 +0100 Subject: [PATCH 01/29] Refactor workflow --- .github/workflows/publish_plugin.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index bc8ac8c364..4d7ca2e788 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -5,17 +5,15 @@ on: workflow_dispatch: jobs: - upload-to-registry: - name: Upload plugin to the registry + check-version: + name: Check snforge_scarb_plugin Version runs-on: ubuntu-latest - env: - SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} + outputs: + snforge_scarb_plugin_uploaded: ${{ steps.check-version.outputs.snforge_scarb_plugin_uploaded }} steps: - uses: actions/checkout@v4 - - name: Check version id: check-version - if: ${{ github.event_name != 'workflow_dispatch' }} run: | set -exo pipefail @@ -23,15 +21,23 @@ jobs: snforge_scarb_plugin_uploaded=$(curl -s https://scarbs.xyz/api/v1/index/sn/fo/snforge_scarb_plugin.json | jq --arg version "$snforge_scarb_plugin_version" '[.[] | select(.v == $version)] | length > 0') echo "snforge_scarb_plugin_uploaded=$snforge_scarb_plugin_uploaded" >> $GITHUB_OUTPUT - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable + build-binaries: + + upload-to-registry: + name: Upload snforge_scarb_plugin to the registry + runs-on: ubuntu-latest + needs: check-version + env: + SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable - uses: software-mansion/setup-scarb@v1 with: scarb-version: "2.8.5" - name: Publish snforge_scarb_plugin - if: ${{ steps.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' }} + if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' working-directory: crates/snforge-scarb-plugin run: scarb publish From fd1e551d81319883008767daae46b46c2b038077 Mon Sep 17 00:00:00 2001 From: kkawula Date: Mon, 20 Jan 2025 09:29:02 +0100 Subject: [PATCH 02/29] Wip --- .github/workflows/publish_plugin.yml | 110 ++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 4d7ca2e788..011dadd3a9 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -22,12 +22,101 @@ jobs: echo "snforge_scarb_plugin_uploaded=$snforge_scarb_plugin_uploaded" >> $GITHUB_OUTPUT build-binaries: + name: Build ${{ matrix.target }} + needs: check-version + runs-on: ${{ matrix.os }} + + env: + # Cross-compiled targets will override this to `cross`. + CARGO: cargo + + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + # Use cross to link oldest GLIBC possible. + cross: true + ext: "so" + + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + cross: true + ext: "so" + + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + cross: true + ext: "so" + + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + cross: true + ext: "so" + + - target: x86_64-apple-darwin + os: macos-latest + ext: "dylib" + + - target: aarch64-apple-darwin + os: macos-latest + ext: "dylib" + + - target: x86_64-pc-windows-msvc + os: windows-latest + ext: "dll" + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + target: ${{ matrix.target }} + + - uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 + + - name: Install cross + if: matrix.cross + uses: taiki-e/install-action@cross + + - name: Enable cross-compilation + if: matrix.cross + shell: bash + run: | + echo "CARGO=cross" >> $GITHUB_ENV + + - name: Build + working-directory: crates/snforge-scarb-plugin + run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} + + - name: Rename Binary + shell: bash + run: | + set -euxo pipefail + + PACKAGE_NAME="snforge_scarb_plugin" + PACKAGE_VERSION=$(grep version crates/snforge-scarb-plugin/Scarb.toml | cut -d '"' -f 2) + + TARGET="${{ matrix.target }}" + EXT="${{ matrix.ext }}" + + OUTPUT_BINARY="${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${EXT}" + + cp ./target/${TARGET}/release/*.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} + + OUTPUT_BINARY_PATH="./target/${TARGET}/release/${OUTPUT_BINARY}" + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.target }} + path: ${{ env.OUTPUT_BINARY_PATH }} + compression-level: 0 upload-to-registry: name: Upload snforge_scarb_plugin to the registry runs-on: ubuntu-latest - needs: check-version + needs: [check-version, build-binaries] env: SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} steps: @@ -37,6 +126,25 @@ jobs: with: scarb-version: "2.8.5" + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts-dl + + - name: Debug 1 + shell: bash + run: ls artifacts-dl + + - name: Move artifacts to staging director + shell: bash + run: | + mkdir -p crates/snforge-scarb-plugin/target/scarb/cairo-plugin + mv artifacts-dl/build-* crates/snforge-scarb-plugin/target/scarb/cairo-plugin/ + + - name: Debug 2 + shell: bash + run: ls crates/snforge-scarb-plugin/target/scarb/cairo-plugin + - name: Publish snforge_scarb_plugin if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' working-directory: crates/snforge-scarb-plugin From cb8a3d5200e648cd8ee68708ce97e710cde9955c Mon Sep 17 00:00:00 2001 From: kkawula Date: Mon, 20 Jan 2025 09:45:49 +0100 Subject: [PATCH 03/29] Remove other workflows --- .github/workflows/ci.yml | 355 ----------------------------- .github/workflows/docs.yml | 103 --------- .github/workflows/label_issues.yml | 20 -- .github/workflows/release.yml | 283 ----------------------- .github/workflows/scheduled.yml | 126 ---------- 5 files changed, 887 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/label_issues.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/scheduled.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 2c644924a4..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,355 +0,0 @@ -name: CI - -env: - DEVNET_REV: ef789b700770fa27a2fc057b3d1c610771be27d9 - -on: - pull_request: - merge_group: - push: - branches: - - master - workflow_dispatch: - -jobs: - test-forge-unit-and-integration: - name: Test Forge / Unit and Integration Tests - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, windows-latest ] - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - run: cargo test --release --lib -p forge - - run: cargo test --release integration -p forge - - build-test-forge-e2e-nextest-archive: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, windows-latest ] - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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-e2e: - name: Test Forge / E2E Tests - runs-on: ${{ matrix.os }} - needs: build-test-forge-e2e-nextest-archive - strategy: - fail-fast: false - matrix: - partition: [ 1, 2, 3, 4, 5, 6, 7, 8 ] - os: [ ubuntu-latest, windows-latest ] - 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: Print repo name - run: echo 'The repo name is' $REPO_NAME - shell: bash - - - name: Get branch name - run: echo 'The branch name is' $BRANCH_NAME - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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 }}/8 - run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/8' --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' e2e - - test-scarb-2-8-3: - name: Test scarb 2.8.3 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: "2.8.3" - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - - name: Install cairo-coverage - run: | - curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh - - - run: cargo test --package forge --features scarb_2_8_3 --test main e2e::coverage - - run: cargo test --package forge --features scarb_2_8_3 --test main e2e::backtrace - - test-coverage-error: - name: Test coverage error - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: "2.7.1" - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - - name: Install cairo-coverage - run: | - curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh - - - run: cargo test --package forge --features scarb_2_7_1 --test main e2e::coverage::test_fail_on_scarb_version_lt_2_8_0 - - test-contracts-artifacts: - name: Test contracts artifacts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: "2.8.3" - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - run: | - cargo test --package forge --features scarb_2_8_3 e2e::contract_artifacts - - run: | - cargo test --package forge --features scarb_2_8_3 e2e::features - - run: | - cargo test --package scarb-api --features scarb_2_8_3 get_starknet_artifacts_path - - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - name: Run Data Transformer tests - run: cargo test --release -p data-transformer - - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - name: Run Forge Scarb Plugin tests - run: cargo test --release -p snforge_scarb_plugin - - test-cast: - name: Test Cast - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, windows-latest ] - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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 - with: - scarb-version: "2.7.0" - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - name: Run tests - run: cargo test --release -p sncast - - test-conversions: - name: Test Conversions - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - run: cargo test --release -p shared - - test-scarb-api: - name: Test Scarb Api - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, windows-latest ] - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - run: cargo lint - - build-docs: - name: Test Building Docs - runs-on: ubuntu-latest - env: - MDBOOK_VERSION: 0.4.31 - steps: - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - 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/typos@v1.26.8 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 122c7b2df2..0000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Initial version from: https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml -# -name: Deploy mdBook site to Pages - -on: - # Allows using this workflow in other workflows - workflow_call: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - release: - types: - - released - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - env: - MDBOOK_VERSION: 0.4.31 - steps: - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - name: Install sitemap CLI - run: | - npm i -g static-sitemap-cli - - name: Install mdBook - run: | - cargo install --version ${MDBOOK_VERSION} mdbook - - name: Install mdBook Link-Check - run: | - cargo install mdbook-linkcheck - - name: Install Scarb - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: latest - - name: Generate and build snforge_std docs - run: | - scarb doc - pushd target/doc/snforge_std - mdbook build - working-directory: ./snforge_std - - name: Generate and build sncast_std docs - run: | - scarb doc - pushd target/doc/sncast_std - mdbook build - working-directory: ./sncast_std - - name: Setup Pages - id: pages - uses: actions/configure-pages@v5 - - name: Build with mdBook - run: mdbook build - working-directory: ./docs - - name: Add snforge_std docs - run: | - mkdir -p ./docs/book/html/snforge_std - cp -r ./snforge_std/target/doc/snforge_std/book/* ./docs/book/html/snforge_std/ - - name: Add sncast_std docs - run: | - mkdir -p ./docs/book/html/sncast_std - cp -r ./sncast_std/target/doc/sncast_std/book/* ./docs/book/html/sncast_std/ - - name: Apply custom highlighting - run: | - curl -o highlight.js https://raw.githubusercontent.com/software-mansion/scarb/main/extensions/scarb-doc/theme/highlight.js - cp highlight.js ./docs/book/html/sncast_std/highlight.js - cp highlight.js ./docs/book/html/snforge_std/highlight.js - - name: Generate sitemap - run: | - sscli --base https://foundry-rs.github.io/starknet-foundry - working-directory: ./docs/book/html - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./docs/book/html - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/label_issues.yml b/.github/workflows/label_issues.yml deleted file mode 100644 index 3e4d4c5dfe..0000000000 --- a/.github/workflows/label_issues.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Label issues -on: - issues: - types: - - opened -jobs: - label_issues: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - uses: actions/github-script@v7 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ["new"] - }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1ccf3a013d..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,283 +0,0 @@ -name: Release - -on: - push: - branches: - - 'master' - tags: - - v[0-9]+.* - -permissions: - contents: write - -jobs: - verify-version: - name: Verify that version that triggered this workflow is greater than most recent release - runs-on: ubuntu-latest - outputs: - versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} - version: ${{ steps.validVersion.outputs.version }} - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: 'npm' - cache-dependency-path: scripts/package-lock.json - - run: npm ci - working-directory: scripts - - - name: Get version from Cargo.toml - id: lookupVersion - uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 - with: - cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' - - - name: Get version from the latest releases - id: lookupVersionRelease - uses: pozetroninc/github-action-get-latest-release@master - with: - owner: foundry-rs - repo: starknet-foundry - excludes: prerelease, draft - - - name: Compare versions - id: validVersion - run: | - RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} - COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} - echo "Project version from newest release = $RELEASE_VERSION" - echo "Project version from this commit = $COMMIT_VERSION" - IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) - echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" - echo "version=$COMMIT_VERSION" >> "$GITHUB_OUTPUT" - - - name: Output job skipped - if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} - run: echo "Version from commit is not greater from newest release, skipping build" - - build-binaries: - name: Build ${{ matrix.target }} - needs: verify-version - if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} - runs-on: ${{ matrix.os }} - continue-on-error: true - - env: - # Cross-compiled targets will override this to `cross`. - CARGO: cargo - - strategy: - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - # Use cross to link oldest GLIBC possible. - cross: true - - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - cross: true - - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - cross: true - - - target: x86_64-apple-darwin - os: macos-latest - - - target: aarch64-apple-darwin - os: macos-latest - - - target: x86_64-pc-windows-msvc - os: windows-latest - - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - target: ${{ matrix.target }} - - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - with: - workspaces: starknet-foundry - - - name: Install cross - if: matrix.cross - uses: taiki-e/install-action@cross - - - name: Enable cross-compilation - if: matrix.cross - shell: bash - run: | - echo "CARGO=cross" >> $GITHUB_ENV - - - name: Build - run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} - - - name: Package - shell: bash - run: | - set -euxo pipefail - PKG_FULL_NAME="starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}" - echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV - - chmod +x ./scripts/package.sh - ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: build-${{ matrix.target }} - path: ${{ env.PKG_FULL_NAME }}.* - - test-binary: - name: Test binary - runs-on: ${{ matrix.os }} - needs: [ build-binaries, verify-version ] - - strategy: - fail-fast: true - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - - - target: x86_64-apple-darwin - os: macos-latest - - - target: x86_64-pc-windows-msvc - os: windows-latest - - steps: - - uses: actions/checkout@v4 - - uses: software-mansion/setup-scarb@v1 - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts-dl - - - name: Move artifacts to staging director - shell: bash - run: | - mkdir -p artifacts - mv artifacts-dl/build-*/starknet-foundry-* artifacts/ - - - name: Get binary path - shell: bash - run: | - if [[ ${{ matrix.target }} == *windows* ]]; then - BINARY_PATH="artifacts/starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}.zip" - else - BINARY_PATH="artifacts/starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}.tar.gz" - fi - echo "BINARY_PATH=$BINARY_PATH" >> $GITHUB_ENV - - - name: Unpack artifact - shell: bash - run: | - if [[ ${{ matrix.target }} == *windows* ]]; then - unzip ${{ env.BINARY_PATH }} - else - tar xzvf ${{ env.BINARY_PATH }} - fi - - - name: Install universal-sierra-compiler - uses: software-mansion/setup-universal-sierra-compiler@v1 - - - name: Smoke test - shell: bash - env: - RPC_URL: "http://188.34.188.184:7070/rpc/v0_7" - run: | - BINARY_PATH="${{ env.BINARY_PATH }}" - BINARY_PATH="${BINARY_PATH%.tar.gz}" - BINARY_PATH="${BINARY_PATH%.zip}" - BINARY_PATH="${BINARY_PATH#artifacts/}" - - if [[ ${{ matrix.target }} == *windows* ]]; then - SNFORGE_PATH=$(readlink -f $BINARY_PATH/bin/snforge.exe) - SNCAST_PATH=$(readlink -f $BINARY_PATH/bin/sncast.exe) - else - SNFORGE_PATH=$(readlink -f $BINARY_PATH/bin/snforge) - SNCAST_PATH=$(readlink -f $BINARY_PATH/bin/sncast) - fi - - REPO_URL=${{ github.repositoryUrl }} - REVISION=${{ github.sha }} - - ./scripts/smoke_test.sh "$RPC_URL" "$SNFORGE_PATH" "$SNCAST_PATH" "$REPO_URL" "$REVISION" - - create-release: - name: Create release - runs-on: ubuntu-latest - needs: [ test-binary, verify-version ] - steps: - - uses: actions/checkout@v4 - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts-dl - - - name: Unpack artifacts to staging directory - run: | - mkdir -p artifacts - mv artifacts-dl/build-*/starknet-foundry-* artifacts/ - - - name: Create GitHub release - id: create-release - uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - draft: true - changelog: CHANGELOG.md - allow-missing-changelog: false - title: $version - ref: refs/tags/${{ needs.verify-version.outputs.version }} - - - name: Upload artifacts to the release - working-directory: artifacts - run: gh release upload "$TAG" * - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ steps.create-release.outputs.computed-prefix }}${{ steps.create-release.outputs.version }} - - publish-snforge-scarb-plugin: - name: Publish snforge_scarb_plugin - uses: ./.github/workflows/publish_plugin.yml - secrets: inherit - - publish-to-registry: - name: Publish packages to the registry - runs-on: ubuntu-latest - needs: [ create-release, publish-snforge-scarb-plugin ] - env: - SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a - with: - toolchain: stable - - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: "2.8.5" - - - name: Publish sncast_std - working-directory: sncast_std - run: scarb publish --allow-dirty - - - name: Publish snforge_std - working-directory: snforge_std - run: | - ../scripts/set_plugin_version.sh - scarb publish --allow-dirty diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml deleted file mode 100644 index 596c5d7449..0000000000 --- a/.github/workflows/scheduled.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Scheduled - -on: - pull_request: - paths: - - scripts/get_scarb_versions.sh - - .github/workflows/scheduled.yml - schedule: - - cron: '0 0 * * 3,0' - workflow_dispatch: - -jobs: - get-scarb-versions: - name: Get Scarb versions - outputs: - versions: ${{ steps.get_versions.outputs.versions }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 - with: - tool_versions: | - scarb latest - - - name: Get versions - id: get_versions - run: | - scarb_versions=$(./scripts/get_scarb_versions.sh) - echo ${scarb_versions[@]} - echo "versions=[${scarb_versions[@]}]" >> "$GITHUB_OUTPUT" - - test-forge-unit-and-integration: - runs-on: ubuntu-latest - needs: get-scarb-versions - strategy: - fail-fast: false - matrix: - version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: ${{ matrix.version }} - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - - run: cargo test --release --lib -p forge - - run: cargo test --release -p forge integration - - test-forge-e2e: - runs-on: ubuntu-latest - needs: get-scarb-versions - strategy: - fail-fast: false - matrix: - version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} - - steps: - - name: Extract branch name - if: github.event_name != 'pull_request' - run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV - - - name: Extract branch name on pull request - if: github.event_name == 'pull_request' - run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV - - - name: Extract repo name and owner - if: github.event_name != 'pull_request' - run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV - - - 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 - - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: ${{ matrix.version }} - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - name: Install cairo-profiler - run: | - curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh - - uses: taiki-e/install-action@nextest - - - run: cargo test --release -p forge e2e - - test-cast: - runs-on: ubuntu-latest - needs: get-scarb-versions - strategy: - fail-fast: false - matrix: - version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: ${{ matrix.version }} - - uses: software-mansion/setup-universal-sierra-compiler@v1 - - - name: Install starknet-devnet-rs - run: ./scripts/install_devnet.sh - - - run: cargo test --release -p sncast - - notify_if_failed: - runs-on: ubuntu-latest - if: always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' - needs: [ test-forge-unit-and-integration, test-forge-e2e, test-cast ] - steps: - - name: Notify that the workflow has failed - uses: slackapi/slack-github-action@v1.27.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SCHEDULED_TESTS_FAILURE_WEBHOOK_URL }} - with: - payload: | - { - "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } From 563c89e49674aa7708f90ec399ae54aaae68837e Mon Sep 17 00:00:00 2001 From: kkawula Date: Mon, 20 Jan 2025 09:46:33 +0100 Subject: [PATCH 04/29] Comment publish_plugin.yml --- .github/workflows/publish_plugin.yml | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 011dadd3a9..4abaac0a44 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -53,18 +53,18 @@ jobs: os: ubuntu-latest cross: true ext: "so" - - - target: x86_64-apple-darwin - os: macos-latest - ext: "dylib" - - - target: aarch64-apple-darwin - os: macos-latest - ext: "dylib" - - - target: x86_64-pc-windows-msvc - os: windows-latest - ext: "dll" +# +# - target: x86_64-apple-darwin +# os: macos-latest +# ext: "dylib" +# +# - target: aarch64-apple-darwin +# os: macos-latest +# ext: "dylib" +# +# - target: x86_64-pc-windows-msvc +# os: windows-latest +# ext: "dll" steps: - uses: actions/checkout@v4 @@ -145,7 +145,7 @@ jobs: shell: bash run: ls crates/snforge-scarb-plugin/target/scarb/cairo-plugin - - name: Publish snforge_scarb_plugin - if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' - working-directory: crates/snforge-scarb-plugin - run: scarb publish +# - name: Publish snforge_scarb_plugin +# if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' +# working-directory: crates/snforge-scarb-plugin +# run: scarb publish From ade6fdc7915ad5bd851f0bf6f8943df89749ee0f Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 21 Jan 2025 11:05:21 +0100 Subject: [PATCH 05/29] Update workflow --- .github/workflows/publish_plugin.yml | 69 +++++++++++++--------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 4abaac0a44..08e3c019e3 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -39,32 +39,33 @@ jobs: cross: true ext: "so" - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - cross: true - ext: "so" - - target: aarch64-unknown-linux-gnu os: ubuntu-latest cross: true ext: "so" - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - cross: true - ext: "so" -# -# - target: x86_64-apple-darwin -# os: macos-latest -# ext: "dylib" -# -# - target: aarch64-apple-darwin -# os: macos-latest -# ext: "dylib" -# -# - target: x86_64-pc-windows-msvc -# os: windows-latest -# ext: "dll" + - target: x86_64-apple-darwin + os: macos-latest + ext: "dylib" + + - target: aarch64-apple-darwin + os: macos-latest + ext: "dylib" + + - target: x86_64-pc-windows-msvc + os: windows-latest + ext: "dll" + + # - target: aarch64-unknown-linux-musl + # os: ubuntu-latest + # cross: true + # ext: "so" + + # - target: x86_64-unknown-linux-musl + # os: ubuntu-latest + # cross: true + # ext: "so" + steps: - uses: actions/checkout@v4 @@ -104,7 +105,7 @@ jobs: cp ./target/${TARGET}/release/*.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} - OUTPUT_BINARY_PATH="./target/${TARGET}/release/${OUTPUT_BINARY}" + echo "OUTPUT_BINARY_PATH=./target/${TARGET}/release/${OUTPUT_BINARY}" >> $GITHUB_ENV - name: Upload Artifact uses: actions/upload-artifact@v4 @@ -124,28 +125,22 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.8.5" + scarb-version: "2.10.0-rc.1" - name: Download artifacts uses: actions/download-artifact@v4 with: path: artifacts-dl - - name: Debug 1 - shell: bash - run: ls artifacts-dl - - - name: Move artifacts to staging director + - name: Unpack artifacts to target directory shell: bash run: | + set -euxo pipefail mkdir -p crates/snforge-scarb-plugin/target/scarb/cairo-plugin - mv artifacts-dl/build-* crates/snforge-scarb-plugin/target/scarb/cairo-plugin/ - - - name: Debug 2 - shell: bash - run: ls crates/snforge-scarb-plugin/target/scarb/cairo-plugin + + mv artifacts-dl/build-*/snforge_scarb_plugin_* crates/snforge-scarb-plugin/target/scarb/cairo-plugin/ -# - name: Publish snforge_scarb_plugin -# if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' -# working-directory: crates/snforge-scarb-plugin -# run: scarb publish + - name: Publish snforge_scarb_plugin + if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' + working-directory: crates/snforge-scarb-plugin + run: scarb publish From 371e636c49507a79f7ee7ee43feef41570e8ae35 Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 21 Jan 2025 11:13:36 +0100 Subject: [PATCH 06/29] Update workflow --- .github/workflows/publish_plugin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 08e3c019e3..4d38295ae5 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -24,6 +24,7 @@ jobs: build-binaries: name: Build ${{ matrix.target }} needs: check-version + if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' runs-on: ${{ matrix.os }} env: From 9fb9d540ade7c8e9343503bb72aea9a9ab478f0b Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 21 Jan 2025 11:15:55 +0100 Subject: [PATCH 07/29] Revert "Remove other workflows" This reverts commit cb8a3d5200e648cd8ee68708ce97e710cde9955c. --- .github/workflows/ci.yml | 355 +++++++++++++++++++++++++++++ .github/workflows/docs.yml | 103 +++++++++ .github/workflows/label_issues.yml | 20 ++ .github/workflows/release.yml | 283 +++++++++++++++++++++++ .github/workflows/scheduled.yml | 126 ++++++++++ 5 files changed, 887 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/label_issues.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/scheduled.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..2c644924a4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,355 @@ +name: CI + +env: + DEVNET_REV: ef789b700770fa27a2fc057b3d1c610771be27d9 + +on: + pull_request: + merge_group: + push: + branches: + - master + workflow_dispatch: + +jobs: + test-forge-unit-and-integration: + name: Test Forge / Unit and Integration Tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - run: cargo test --release --lib -p forge + - run: cargo test --release integration -p forge + + build-test-forge-e2e-nextest-archive: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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-e2e: + name: Test Forge / E2E Tests + runs-on: ${{ matrix.os }} + needs: build-test-forge-e2e-nextest-archive + strategy: + fail-fast: false + matrix: + partition: [ 1, 2, 3, 4, 5, 6, 7, 8 ] + os: [ ubuntu-latest, windows-latest ] + 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: Print repo name + run: echo 'The repo name is' $REPO_NAME + shell: bash + + - name: Get branch name + run: echo 'The branch name is' $BRANCH_NAME + 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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 }}/8 + run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/8' --archive-file 'nextest-archive-${{ matrix.os }}.tar.zst' e2e + + test-scarb-2-8-3: + name: Test scarb 2.8.3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.3" + - uses: software-mansion/setup-universal-sierra-compiler@v1 + + - name: Install cairo-coverage + run: | + curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh + + - run: cargo test --package forge --features scarb_2_8_3 --test main e2e::coverage + - run: cargo test --package forge --features scarb_2_8_3 --test main e2e::backtrace + + test-coverage-error: + name: Test coverage error + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.7.1" + - uses: software-mansion/setup-universal-sierra-compiler@v1 + + - name: Install cairo-coverage + run: | + curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh + + - run: cargo test --package forge --features scarb_2_7_1 --test main e2e::coverage::test_fail_on_scarb_version_lt_2_8_0 + + test-contracts-artifacts: + name: Test contracts artifacts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.3" + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - run: | + cargo test --package forge --features scarb_2_8_3 e2e::contract_artifacts + - run: | + cargo test --package forge --features scarb_2_8_3 e2e::features + - run: | + cargo test --package scarb-api --features scarb_2_8_3 get_starknet_artifacts_path + + 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - name: Run Data Transformer tests + run: cargo test --release -p data-transformer + + 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - name: Run Forge Scarb Plugin tests + run: cargo test --release -p snforge_scarb_plugin + + test-cast: + name: Test Cast + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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 + with: + scarb-version: "2.7.0" + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - name: Run tests + run: cargo test --release -p sncast + + test-conversions: + name: Test Conversions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - run: cargo test --release -p shared + + test-scarb-api: + name: Test Scarb Api + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - run: cargo lint + + build-docs: + name: Test Building Docs + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.31 + steps: + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - 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/typos@v1.26.8 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..122c7b2df2 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,103 @@ +# Initial version from: https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml +# +name: Deploy mdBook site to Pages + +on: + # Allows using this workflow in other workflows + workflow_call: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + + release: + types: + - released + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: 0.4.31 + steps: + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Install sitemap CLI + run: | + npm i -g static-sitemap-cli + - name: Install mdBook + run: | + cargo install --version ${MDBOOK_VERSION} mdbook + - name: Install mdBook Link-Check + run: | + cargo install mdbook-linkcheck + - name: Install Scarb + uses: software-mansion/setup-scarb@v1 + with: + scarb-version: latest + - name: Generate and build snforge_std docs + run: | + scarb doc + pushd target/doc/snforge_std + mdbook build + working-directory: ./snforge_std + - name: Generate and build sncast_std docs + run: | + scarb doc + pushd target/doc/sncast_std + mdbook build + working-directory: ./sncast_std + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Build with mdBook + run: mdbook build + working-directory: ./docs + - name: Add snforge_std docs + run: | + mkdir -p ./docs/book/html/snforge_std + cp -r ./snforge_std/target/doc/snforge_std/book/* ./docs/book/html/snforge_std/ + - name: Add sncast_std docs + run: | + mkdir -p ./docs/book/html/sncast_std + cp -r ./sncast_std/target/doc/sncast_std/book/* ./docs/book/html/sncast_std/ + - name: Apply custom highlighting + run: | + curl -o highlight.js https://raw.githubusercontent.com/software-mansion/scarb/main/extensions/scarb-doc/theme/highlight.js + cp highlight.js ./docs/book/html/sncast_std/highlight.js + cp highlight.js ./docs/book/html/snforge_std/highlight.js + - name: Generate sitemap + run: | + sscli --base https://foundry-rs.github.io/starknet-foundry + working-directory: ./docs/book/html + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs/book/html + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/label_issues.yml b/.github/workflows/label_issues.yml new file mode 100644 index 0000000000..3e4d4c5dfe --- /dev/null +++ b/.github/workflows/label_issues.yml @@ -0,0 +1,20 @@ +name: Label issues +on: + issues: + types: + - opened +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/github-script@v7 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["new"] + }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..1ccf3a013d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,283 @@ +name: Release + +on: + push: + branches: + - 'master' + tags: + - v[0-9]+.* + +permissions: + contents: write + +jobs: + verify-version: + name: Verify that version that triggered this workflow is greater than most recent release + runs-on: ubuntu-latest + outputs: + versionIsValid: ${{ steps.validVersion.outputs.versionIsValid }} + version: ${{ steps.validVersion.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + cache: 'npm' + cache-dependency-path: scripts/package-lock.json + - run: npm ci + working-directory: scripts + + - name: Get version from Cargo.toml + id: lookupVersion + uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 + with: + cmd: yq -oy '"v" + .workspace.package.version' 'Cargo.toml' + + - name: Get version from the latest releases + id: lookupVersionRelease + uses: pozetroninc/github-action-get-latest-release@master + with: + owner: foundry-rs + repo: starknet-foundry + excludes: prerelease, draft + + - name: Compare versions + id: validVersion + run: | + RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }} + COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }} + echo "Project version from newest release = $RELEASE_VERSION" + echo "Project version from this commit = $COMMIT_VERSION" + IS_VALID=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION) + echo "versionIsValid=$IS_VALID" >> "$GITHUB_OUTPUT" + echo "version=$COMMIT_VERSION" >> "$GITHUB_OUTPUT" + + - name: Output job skipped + if: ${{ steps.validVersion.outputs.versionIsValid == 'false' }} + run: echo "Version from commit is not greater from newest release, skipping build" + + build-binaries: + name: Build ${{ matrix.target }} + needs: verify-version + if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }} + runs-on: ${{ matrix.os }} + continue-on-error: true + + env: + # Cross-compiled targets will override this to `cross`. + CARGO: cargo + + strategy: + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + # Use cross to link oldest GLIBC possible. + cross: true + + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + cross: true + + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + cross: true + + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + cross: true + + - target: x86_64-apple-darwin + os: macos-latest + + - target: aarch64-apple-darwin + os: macos-latest + + - target: x86_64-pc-windows-msvc + os: windows-latest + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + target: ${{ matrix.target }} + + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + with: + workspaces: starknet-foundry + + - name: Install cross + if: matrix.cross + uses: taiki-e/install-action@cross + + - name: Enable cross-compilation + if: matrix.cross + shell: bash + run: | + echo "CARGO=cross" >> $GITHUB_ENV + + - name: Build + run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} + + - name: Package + shell: bash + run: | + set -euxo pipefail + PKG_FULL_NAME="starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}" + echo "PKG_FULL_NAME=$PKG_FULL_NAME" >> $GITHUB_ENV + + chmod +x ./scripts/package.sh + ./scripts/package.sh "${{ matrix.target }}" "$PKG_FULL_NAME" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.target }} + path: ${{ env.PKG_FULL_NAME }}.* + + test-binary: + name: Test binary + runs-on: ${{ matrix.os }} + needs: [ build-binaries, verify-version ] + + strategy: + fail-fast: true + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + + - target: x86_64-apple-darwin + os: macos-latest + + - target: x86_64-pc-windows-msvc + os: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: software-mansion/setup-scarb@v1 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts-dl + + - name: Move artifacts to staging director + shell: bash + run: | + mkdir -p artifacts + mv artifacts-dl/build-*/starknet-foundry-* artifacts/ + + - name: Get binary path + shell: bash + run: | + if [[ ${{ matrix.target }} == *windows* ]]; then + BINARY_PATH="artifacts/starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}.zip" + else + BINARY_PATH="artifacts/starknet-foundry-${{ needs.verify-version.outputs.version }}-${{ matrix.target }}.tar.gz" + fi + echo "BINARY_PATH=$BINARY_PATH" >> $GITHUB_ENV + + - name: Unpack artifact + shell: bash + run: | + if [[ ${{ matrix.target }} == *windows* ]]; then + unzip ${{ env.BINARY_PATH }} + else + tar xzvf ${{ env.BINARY_PATH }} + fi + + - name: Install universal-sierra-compiler + uses: software-mansion/setup-universal-sierra-compiler@v1 + + - name: Smoke test + shell: bash + env: + RPC_URL: "http://188.34.188.184:7070/rpc/v0_7" + run: | + BINARY_PATH="${{ env.BINARY_PATH }}" + BINARY_PATH="${BINARY_PATH%.tar.gz}" + BINARY_PATH="${BINARY_PATH%.zip}" + BINARY_PATH="${BINARY_PATH#artifacts/}" + + if [[ ${{ matrix.target }} == *windows* ]]; then + SNFORGE_PATH=$(readlink -f $BINARY_PATH/bin/snforge.exe) + SNCAST_PATH=$(readlink -f $BINARY_PATH/bin/sncast.exe) + else + SNFORGE_PATH=$(readlink -f $BINARY_PATH/bin/snforge) + SNCAST_PATH=$(readlink -f $BINARY_PATH/bin/sncast) + fi + + REPO_URL=${{ github.repositoryUrl }} + REVISION=${{ github.sha }} + + ./scripts/smoke_test.sh "$RPC_URL" "$SNFORGE_PATH" "$SNCAST_PATH" "$REPO_URL" "$REVISION" + + create-release: + name: Create release + runs-on: ubuntu-latest + needs: [ test-binary, verify-version ] + steps: + - uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts-dl + + - name: Unpack artifacts to staging directory + run: | + mkdir -p artifacts + mv artifacts-dl/build-*/starknet-foundry-* artifacts/ + + - name: Create GitHub release + id: create-release + uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: true + changelog: CHANGELOG.md + allow-missing-changelog: false + title: $version + ref: refs/tags/${{ needs.verify-version.outputs.version }} + + - name: Upload artifacts to the release + working-directory: artifacts + run: gh release upload "$TAG" * + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.create-release.outputs.computed-prefix }}${{ steps.create-release.outputs.version }} + + publish-snforge-scarb-plugin: + name: Publish snforge_scarb_plugin + uses: ./.github/workflows/publish_plugin.yml + secrets: inherit + + publish-to-registry: + name: Publish packages to the registry + runs-on: ubuntu-latest + needs: [ create-release, publish-snforge-scarb-plugin ] + env: + SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a + with: + toolchain: stable + + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.5" + + - name: Publish sncast_std + working-directory: sncast_std + run: scarb publish --allow-dirty + + - name: Publish snforge_std + working-directory: snforge_std + run: | + ../scripts/set_plugin_version.sh + scarb publish --allow-dirty diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 0000000000..596c5d7449 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -0,0 +1,126 @@ +name: Scheduled + +on: + pull_request: + paths: + - scripts/get_scarb_versions.sh + - .github/workflows/scheduled.yml + schedule: + - cron: '0 0 * * 3,0' + workflow_dispatch: + +jobs: + get-scarb-versions: + name: Get Scarb versions + outputs: + versions: ${{ steps.get_versions.outputs.versions }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 + with: + tool_versions: | + scarb latest + + - name: Get versions + id: get_versions + run: | + scarb_versions=$(./scripts/get_scarb_versions.sh) + echo ${scarb_versions[@]} + echo "versions=[${scarb_versions[@]}]" >> "$GITHUB_OUTPUT" + + test-forge-unit-and-integration: + runs-on: ubuntu-latest + needs: get-scarb-versions + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: ${{ matrix.version }} + - uses: software-mansion/setup-universal-sierra-compiler@v1 + + - run: cargo test --release --lib -p forge + - run: cargo test --release -p forge integration + + test-forge-e2e: + runs-on: ubuntu-latest + needs: get-scarb-versions + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} + + steps: + - name: Extract branch name + if: github.event_name != 'pull_request' + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Extract branch name on pull request + if: github.event_name == 'pull_request' + run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV + + - name: Extract repo name and owner + if: github.event_name != 'pull_request' + run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV + + - 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 + + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: ${{ matrix.version }} + - uses: software-mansion/setup-universal-sierra-compiler@v1 + - name: Install cairo-profiler + run: | + curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh + - uses: taiki-e/install-action@nextest + + - run: cargo test --release -p forge e2e + + test-cast: + runs-on: ubuntu-latest + needs: get-scarb-versions + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }} + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: ${{ matrix.version }} + - uses: software-mansion/setup-universal-sierra-compiler@v1 + + - name: Install starknet-devnet-rs + run: ./scripts/install_devnet.sh + + - run: cargo test --release -p sncast + + notify_if_failed: + runs-on: ubuntu-latest + if: always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' + needs: [ test-forge-unit-and-integration, test-forge-e2e, test-cast ] + steps: + - name: Notify that the workflow has failed + uses: slackapi/slack-github-action@v1.27.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SCHEDULED_TESTS_FAILURE_WEBHOOK_URL }} + with: + payload: | + { + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } From a02df7d6f5ac825753a137e94539096e914293ee Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 21 Jan 2025 14:07:04 +0100 Subject: [PATCH 08/29] Add add_allow_prebuilt_macros --- crates/forge/src/new.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/forge/src/new.rs b/crates/forge/src/new.rs index 83f3c33f64..3836321bf9 100644 --- a/crates/forge/src/new.rs +++ b/crates/forge/src/new.rs @@ -11,7 +11,7 @@ use std::env; use std::fs::{self, OpenOptions}; use std::io::Write; use std::path::{Path, PathBuf}; -use toml_edit::{value, ArrayOfTables, DocumentMut, Item, Table}; +use toml_edit::{value, Array, ArrayOfTables, DocumentMut, Item, Table, Value}; static TEMPLATE: Dir = include_dir!("starknet_forge_template"); @@ -96,6 +96,7 @@ fn update_config(config_path: &Path, scarb: &Version) -> Result<()> { set_cairo_edition(&mut document, CAIRO_EDITION); add_test_script(&mut document); add_assert_macros(&mut document, scarb)?; + add_allow_prebuilt_macros(&mut document)?; fs::write(config_path, document.to_string())?; @@ -142,6 +143,27 @@ fn add_assert_macros(document: &mut DocumentMut, scarb: &Version) -> Result<()> Ok(()) } +fn add_allow_prebuilt_macros(document: &mut DocumentMut) -> Result<()> { + let tool_section = document.entry("tool").or_insert(Item::Table(Table::new())); + let tool_table = tool_section + .as_table_mut() + .context("Failed to get tool table from Scarb.toml")?; + + let mut scarb_table = Table::new(); + + let mut allow_prebuilt_macros = Array::new(); + allow_prebuilt_macros.push("snforge_scarb_plugin"); + + scarb_table.insert( + "allow-prebuilt-macros", + Item::Value(Value::Array(allow_prebuilt_macros)), + ); + + tool_table.insert("scarb", Item::Table(scarb_table)); + + Ok(()) +} + fn extend_gitignore(path: &Path) -> Result<()> { if path.join(".gitignore").exists() { let mut file = OpenOptions::new() From 27f9824278840ddc54fe579fe969059c927c42e3 Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 21 Jan 2025 14:33:29 +0100 Subject: [PATCH 09/29] Add include field --- crates/snforge-scarb-plugin/Scarb.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/snforge-scarb-plugin/Scarb.toml b/crates/snforge-scarb-plugin/Scarb.toml index 6c92561508..ed99becfc3 100644 --- a/crates/snforge-scarb-plugin/Scarb.toml +++ b/crates/snforge-scarb-plugin/Scarb.toml @@ -2,5 +2,6 @@ name = "snforge_scarb_plugin" version = "0.35.1" edition = "2024_07" +include = ["target/scarb/cairo-plugin/"] [cairo-plugin] From 1117d7e655dfcfb402e9581c64e03a9e16fdb286 Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 23 Jan 2025 09:37:27 +0100 Subject: [PATCH 10/29] Update settings name --- crates/forge/src/new.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/forge/src/new.rs b/crates/forge/src/new.rs index 3836321bf9..c1b282e120 100644 --- a/crates/forge/src/new.rs +++ b/crates/forge/src/new.rs @@ -152,10 +152,10 @@ fn add_allow_prebuilt_macros(document: &mut DocumentMut) -> Result<()> { let mut scarb_table = Table::new(); let mut allow_prebuilt_macros = Array::new(); - allow_prebuilt_macros.push("snforge_scarb_plugin"); + allow_prebuilt_macros.push("snforge_std"); scarb_table.insert( - "allow-prebuilt-macros", + "allow-prebuilt-plugins", Item::Value(Value::Array(allow_prebuilt_macros)), ); From 9660178dd0d7d3bb32010f926729c7718a2472f7 Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 23 Jan 2025 09:55:20 +0100 Subject: [PATCH 11/29] Fix tests --- crates/forge/tests/e2e/running.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/forge/tests/e2e/running.rs b/crates/forge/tests/e2e/running.rs index d547747a75..df5e924ff5 100644 --- a/crates/forge/tests/e2e/running.rs +++ b/crates/forge/tests/e2e/running.rs @@ -818,6 +818,11 @@ fn validate_init(project_path: &PathBuf, validate_snforge_std: bool) { [scripts] test = "snforge test" + + [tool] + + [tool.scarb] + allow-prebuilt-plugins = ["snforge_std"] {SCARB_MANIFEST_TEMPLATE_CONTENT} "#, snforge_std_assert From 236d80cba3d1e0990231e101e72db5e243532d9c Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 23 Jan 2025 10:12:28 +0100 Subject: [PATCH 12/29] Update CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d86a8e188..48d85d6adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Forge + +#### Added + +- Default support for prebuilt plugin + +### `snforge_scarb_plugin` + +#### Changed + +- Now published with precompiled binaries, eliminating the need for Rust installation. + ## [0.36.0] - 2025-01-15 ### Forge From 4fc095b8098bbe0a36d13c4888c0f36a09909066 Mon Sep 17 00:00:00 2001 From: kkawula <57270771+kkawula@users.noreply.github.com> Date: Sat, 25 Jan 2025 14:16:18 +0100 Subject: [PATCH 13/29] Apply suggestions from code review Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48d85d6adf..efea455a6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,13 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Default support for prebuilt plugin +- Newly created projects won't require Rust to be installed by default ### `snforge_scarb_plugin` #### Changed -- Now published with precompiled binaries, eliminating the need for Rust installation. +- Precompiled plugin binaries are now published to the registry for new versions ## [0.36.0] - 2025-01-15 From 65ce5b472912d0062c934c2ef96a4440589680c6 Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 28 Jan 2025 10:31:38 +0100 Subject: [PATCH 14/29] Add docs --- docs/src/appendix/scarb-toml.md | 9 +++++++++ docs/src/getting-started/first-steps.md | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/src/appendix/scarb-toml.md b/docs/src/appendix/scarb-toml.md index 4f93c4f4e1..37d7ae270b 100644 --- a/docs/src/appendix/scarb-toml.md +++ b/docs/src/appendix/scarb-toml.md @@ -78,6 +78,15 @@ url = "http://your.second.rpc.url" block_id.number = "123" ``` +### `[tool.scarb]` + +```toml +[tool.scarb] +allow-prebuilt-plugins = ["snforge_std"] +``` +It gives `scarb` privilege to download precompiled dependencies used by `snforge_std`. +The `snforge_std` library depends on a Cairo plugin that is written in Rust and, by default, is compiled locally on the user's side. + ### `[profile..cairo]` By default, these arguments do not need to be defined. Only set them to use [profiler](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/profiling.html#profiling) or [coverage](https://foundry-rs.github.io/starknet-foundry/testing/coverage.html#coverage). diff --git a/docs/src/getting-started/first-steps.md b/docs/src/getting-started/first-steps.md index 342b9114c9..5bc7a47deb 100644 --- a/docs/src/getting-started/first-steps.md +++ b/docs/src/getting-started/first-steps.md @@ -100,4 +100,12 @@ Additionally, ensure that starknet-contract target is enabled in the `Scarb.toml ```toml # ... [[target.starknet-contract]] -``` \ No newline at end of file +``` + +> 📝 **Note** +> +> You can additionally specify `scarb` settings to avoid compiling Cairo plugin which `snforge_std` depends on. The plugin is written in Rust and, by default, is compiled locally on the user's side. +> ``` +> [tool.scarb] +> allow-prebuilt-plugins = ["snforge_std"] +> ``` From 109c95ceaec578917da2fcec51b5cc25fff2b9a5 Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 28 Jan 2025 10:45:35 +0100 Subject: [PATCH 15/29] Add comments to workflow --- .github/workflows/publish_plugin.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 4d38295ae5..6dbf8c1567 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -57,6 +57,10 @@ jobs: os: windows-latest ext: "dll" + # The builds for following platforms builds are experimental and are not supported by starknet-foundry team. + # https://docs.swmansion.com/scarb/download.html#platform-support + # Reference issue: TODO(#2886) + # - target: aarch64-unknown-linux-musl # os: ubuntu-latest # cross: true @@ -67,7 +71,6 @@ jobs: # cross: true # ext: "so" - steps: - uses: actions/checkout@v4 From 0229715361f50c42e741d7edebf3966d0255aabb Mon Sep 17 00:00:00 2001 From: kkawula <57270771+kkawula@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:08:14 +0100 Subject: [PATCH 16/29] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Artur Michałek <52135326+cptartur@users.noreply.github.com> --- docs/src/appendix/scarb-toml.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/appendix/scarb-toml.md b/docs/src/appendix/scarb-toml.md index 37d7ae270b..03775ac43d 100644 --- a/docs/src/appendix/scarb-toml.md +++ b/docs/src/appendix/scarb-toml.md @@ -84,7 +84,7 @@ block_id.number = "123" [tool.scarb] allow-prebuilt-plugins = ["snforge_std"] ``` -It gives `scarb` privilege to download precompiled dependencies used by `snforge_std`. +It allow `scarb` to download precompiled dependencies used by `snforge_std`. The `snforge_std` library depends on a Cairo plugin that is written in Rust and, by default, is compiled locally on the user's side. ### `[profile..cairo]` From 2457e7c7246a6b914d15d9cc87b645e404bf755b Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 28 Jan 2025 17:27:08 +0100 Subject: [PATCH 17/29] Rename boolean output --- .github/workflows/publish_plugin.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 6dbf8c1567..7cb6ed41c9 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -9,7 +9,7 @@ jobs: name: Check snforge_scarb_plugin Version runs-on: ubuntu-latest outputs: - snforge_scarb_plugin_uploaded: ${{ steps.check-version.outputs.snforge_scarb_plugin_uploaded }} + is_plugin_already_uploaded: ${{ steps.check-version.outputs.is_plugin_already_uploaded }} steps: - uses: actions/checkout@v4 - name: Check version @@ -18,13 +18,13 @@ jobs: set -exo pipefail snforge_scarb_plugin_version=$(grep version crates/snforge-scarb-plugin/Scarb.toml | cut -d '"' -f 2) - snforge_scarb_plugin_uploaded=$(curl -s https://scarbs.xyz/api/v1/index/sn/fo/snforge_scarb_plugin.json | jq --arg version "$snforge_scarb_plugin_version" '[.[] | select(.v == $version)] | length > 0') - echo "snforge_scarb_plugin_uploaded=$snforge_scarb_plugin_uploaded" >> $GITHUB_OUTPUT + is_plugin_already_uploaded=$(curl -s https://scarbs.xyz/api/v1/index/sn/fo/snforge_scarb_plugin.json | jq --arg version "$snforge_scarb_plugin_version" '[.[] | select(.v == $version)] | length > 0') + echo "is_plugin_already_uploaded=$is_plugin_already_uploaded" >> $GITHUB_OUTPUT build-binaries: name: Build ${{ matrix.target }} needs: check-version - if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' + if: needs.check-version.outputs.is_plugin_already_uploaded == 'false' || github.event_name == 'workflow_dispatch' runs-on: ${{ matrix.os }} env: @@ -145,6 +145,6 @@ jobs: mv artifacts-dl/build-*/snforge_scarb_plugin_* crates/snforge-scarb-plugin/target/scarb/cairo-plugin/ - name: Publish snforge_scarb_plugin - if: needs.check-version.outputs.snforge_scarb_plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' + if: needs.check-version.outputs.is_plugin_already_uploaded == 'false' || github.event_name == 'workflow_dispatch' working-directory: crates/snforge-scarb-plugin run: scarb publish From 115f22c358f3a65f0ffefdeb607068a91b99d28d Mon Sep 17 00:00:00 2001 From: kkawula Date: Tue, 28 Jan 2025 17:33:22 +0100 Subject: [PATCH 18/29] `cp` -> `mv` --- .github/workflows/publish_plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 7cb6ed41c9..d3e8a6de53 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -107,7 +107,7 @@ jobs: OUTPUT_BINARY="${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${EXT}" - cp ./target/${TARGET}/release/*.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} + mv ./target/${TARGET}/release/*.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} echo "OUTPUT_BINARY_PATH=./target/${TARGET}/release/${OUTPUT_BINARY}" >> $GITHUB_ENV From 9d725ffa274a7355108c1aaa82f5681ac0094469 Mon Sep 17 00:00:00 2001 From: kkawula <57270771+kkawula@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:42:04 +0100 Subject: [PATCH 19/29] Apply suggestions from code review Co-authored-by: Wojciech Szymczyk --- .github/workflows/publish_plugin.yml | 2 +- docs/src/appendix/scarb-toml.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index d3e8a6de53..10520c9c55 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -57,7 +57,7 @@ jobs: os: windows-latest ext: "dll" - # The builds for following platforms builds are experimental and are not supported by starknet-foundry team. + # The scarb builds for following platforms are experimental and not officially supported by starknet-foundry. # https://docs.swmansion.com/scarb/download.html#platform-support # Reference issue: TODO(#2886) diff --git a/docs/src/appendix/scarb-toml.md b/docs/src/appendix/scarb-toml.md index 03775ac43d..56d253dd1d 100644 --- a/docs/src/appendix/scarb-toml.md +++ b/docs/src/appendix/scarb-toml.md @@ -84,8 +84,8 @@ block_id.number = "123" [tool.scarb] allow-prebuilt-plugins = ["snforge_std"] ``` -It allow `scarb` to download precompiled dependencies used by `snforge_std`. -The `snforge_std` library depends on a Cairo plugin that is written in Rust and, by default, is compiled locally on the user's side. +It allows `scarb` to download precompiled dependencies used by `snforge_std` from [the registry](https://scarbs.xyz). +The `snforge_std` library depends on a Cairo plugin that is written in Rust, and otherwise is compiled locally on the user's side. ### `[profile..cairo]` By default, these arguments do not need to be defined. Only set them to use [profiler](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/profiling.html#profiling) or [coverage](https://foundry-rs.github.io/starknet-foundry/testing/coverage.html#coverage). From d8e1e5b0aaea795715df9c86fe6b65d8bf03c58b Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 30 Jan 2025 12:35:02 +0100 Subject: [PATCH 20/29] Update creatig table logic --- crates/forge/src/new.rs | 1 + crates/forge/tests/e2e/running.rs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/forge/src/new.rs b/crates/forge/src/new.rs index c1b282e120..2abe4c4638 100644 --- a/crates/forge/src/new.rs +++ b/crates/forge/src/new.rs @@ -148,6 +148,7 @@ fn add_allow_prebuilt_macros(document: &mut DocumentMut) -> Result<()> { let tool_table = tool_section .as_table_mut() .context("Failed to get tool table from Scarb.toml")?; + tool_table.set_implicit(true); let mut scarb_table = Table::new(); diff --git a/crates/forge/tests/e2e/running.rs b/crates/forge/tests/e2e/running.rs index df5e924ff5..4a2087f22d 100644 --- a/crates/forge/tests/e2e/running.rs +++ b/crates/forge/tests/e2e/running.rs @@ -819,8 +819,6 @@ fn validate_init(project_path: &PathBuf, validate_snforge_std: bool) { [scripts] test = "snforge test" - [tool] - [tool.scarb] allow-prebuilt-plugins = ["snforge_std"] {SCARB_MANIFEST_TEMPLATE_CONTENT} From 5f2e33811ea32369f92e9d25098b6473ffb52d00 Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 30 Jan 2025 12:38:14 +0100 Subject: [PATCH 21/29] Update CHANGELOG.md --- CHANGELOG.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efea455a6e..7383330c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,13 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Newly created projects won't require Rust to be installed by default - -### `snforge_scarb_plugin` - -#### Changed - -- Precompiled plugin binaries are now published to the registry for new versions +- Newly created projects won't require Rust to be installed by default, as precompiled plugin binaries are now published to the registry for new versions. ## [0.36.0] - 2025-01-15 From 777d11109e2f9391d0856622908c57af8cff38f8 Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 30 Jan 2025 12:51:20 +0100 Subject: [PATCH 22/29] Rename boolean output --- .github/workflows/publish_plugin.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 10520c9c55..565fd8a5f6 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -9,7 +9,7 @@ jobs: name: Check snforge_scarb_plugin Version runs-on: ubuntu-latest outputs: - is_plugin_already_uploaded: ${{ steps.check-version.outputs.is_plugin_already_uploaded }} + plugin_uploaded: ${{ steps.check-version.outputs.plugin_uploaded }} steps: - uses: actions/checkout@v4 - name: Check version @@ -18,13 +18,13 @@ jobs: set -exo pipefail snforge_scarb_plugin_version=$(grep version crates/snforge-scarb-plugin/Scarb.toml | cut -d '"' -f 2) - is_plugin_already_uploaded=$(curl -s https://scarbs.xyz/api/v1/index/sn/fo/snforge_scarb_plugin.json | jq --arg version "$snforge_scarb_plugin_version" '[.[] | select(.v == $version)] | length > 0') - echo "is_plugin_already_uploaded=$is_plugin_already_uploaded" >> $GITHUB_OUTPUT + plugin_uploaded=$(curl -s https://scarbs.xyz/api/v1/index/sn/fo/snforge_scarb_plugin.json | jq --arg version "$snforge_scarb_plugin_version" '[.[] | select(.v == $version)] | length > 0') + echo "plugin_uploaded=$plugin_uploaded" >> $GITHUB_OUTPUT build-binaries: name: Build ${{ matrix.target }} needs: check-version - if: needs.check-version.outputs.is_plugin_already_uploaded == 'false' || github.event_name == 'workflow_dispatch' + if: needs.check-version.outputs.plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' runs-on: ${{ matrix.os }} env: @@ -145,6 +145,6 @@ jobs: mv artifacts-dl/build-*/snforge_scarb_plugin_* crates/snforge-scarb-plugin/target/scarb/cairo-plugin/ - name: Publish snforge_scarb_plugin - if: needs.check-version.outputs.is_plugin_already_uploaded == 'false' || github.event_name == 'workflow_dispatch' + if: needs.check-version.outputs.plugin_uploaded == 'false' || github.event_name == 'workflow_dispatch' working-directory: crates/snforge-scarb-plugin run: scarb publish From 00a9ef937726a0a1ce0f9a7550a6eb3764a8e537 Mon Sep 17 00:00:00 2001 From: kkawula Date: Thu, 30 Jan 2025 15:06:44 +0100 Subject: [PATCH 23/29] Update docs --- docs/src/appendix/scarb-toml.md | 2 ++ docs/src/getting-started/first-steps.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/src/appendix/scarb-toml.md b/docs/src/appendix/scarb-toml.md index 56d253dd1d..af9ba3ff55 100644 --- a/docs/src/appendix/scarb-toml.md +++ b/docs/src/appendix/scarb-toml.md @@ -84,6 +84,8 @@ block_id.number = "123" [tool.scarb] allow-prebuilt-plugins = ["snforge_std"] ``` +Note: This configuration requires Scarb version >= 2.10.0 . + It allows `scarb` to download precompiled dependencies used by `snforge_std` from [the registry](https://scarbs.xyz). The `snforge_std` library depends on a Cairo plugin that is written in Rust, and otherwise is compiled locally on the user's side. diff --git a/docs/src/getting-started/first-steps.md b/docs/src/getting-started/first-steps.md index 5bc7a47deb..9d68f261e7 100644 --- a/docs/src/getting-started/first-steps.md +++ b/docs/src/getting-started/first-steps.md @@ -109,3 +109,5 @@ Additionally, ensure that starknet-contract target is enabled in the `Scarb.toml > [tool.scarb] > allow-prebuilt-plugins = ["snforge_std"] > ``` +> This configuration requires Scarb version >= 2.10.0 . +> From 7b810a32eb93e17f55ba98522052bad41de30ba4 Mon Sep 17 00:00:00 2001 From: kkawula <57270771+kkawula@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:56:08 +0100 Subject: [PATCH 24/29] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Artur Michałek <52135326+cptartur@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 738842b906..ae4457e621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Newly created projects won't require Rust to be installed by default, as precompiled plugin binaries are now published to the registry for new versions. +- Rust is no longer required to use `snforge` - precompiled `snforge_scarb_plugin` plugin binaries are now published to (package registry)[https://scarbs.xyz/] for new versions. - Added a suggestion for using the `--max-n-steps` flag when the Cairo VM returns the error: `Could not reach the end of the program. RunResources has no remaining steps`. #### Fixed From a25597a285c0c70f052ff089d0fdd046b37aacb6 Mon Sep 17 00:00:00 2001 From: kkawula Date: Fri, 31 Jan 2025 16:11:40 +0100 Subject: [PATCH 25/29] Update docs --- CHANGELOG.md | 2 +- docs/src/getting-started/installation.md | 123 ++++++++++++++--------- 2 files changed, 78 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4457e621..c312fe70be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Rust is no longer required to use `snforge` - precompiled `snforge_scarb_plugin` plugin binaries are now published to (package registry)[https://scarbs.xyz/] for new versions. +- Rust is no longer required to use `snforge` - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. - Added a suggestion for using the `--max-n-steps` flag when the Cairo VM returns the error: `Could not reach the end of the program. RunResources has no remaining steps`. #### Fixed diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index 5e9818face..a51bc050a3 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -10,13 +10,13 @@ In this section, we will walk through the process of installing Starknet Foundry * [Contents](#contents) * [Requirements](#requirements) * [Linux and macOS](#linux-and-macos) - * [Install Rust version >= 1.80.1](#install-rust-version--1801) * [Install asdf](#install-asdf) * [Install Scarb version >= 2.7.0](#install-scarb-version--270) + * [Install Rust version >= 1.80.1](#rust-installation) * [Install Starknet Foundry](#install-starknet-foundry) * [Windows](#windows) - * [Install Rust version >= 1.80.1](#install-rust-version--1801-1) * [Install Scarb version >= 2.7.0](#install-scarb-version--270-1) + * [Install Rust version >= 1.80.1](#rust-installation-1) * [Install Universal Sierra Compiler](#install-universal-sierra-compiler) * [Install Starknet Foundry](#install-starknet-foundry-1) * [Common Errors](#common-errors) @@ -58,31 +58,6 @@ all installed and added to your `PATH` environment variable. > If you already have installed Rust, Scarb and asdf simply run > `asdf plugin add starknet-foundry` -### Install Rust version >= 1.80.1 - -> ℹ️ **Info** -> -> `snforge` relies on Scarb's [_procedural macros_](https://github.com/foundry-rs/starknet-foundry/issues/2299) to -> create -`snforge_scarb_plugin` which is a part of `snforge_std`. -> This plugin is required for `snforge` test to work. -> Currently, _procedural macros_ require Rust installation to function. -> This will be changed in the upcoming versions of Scarb. - -```shell -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -``` - -To verify that correct Rust version was installed, run - -```shell -rustc --version -``` - -and verify that version is >= 1.80.1 - -See [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details. - ### Install asdf Follow the instructions from [asdf docs](https://asdf-vm.com/guide/getting-started.html#getting-started). @@ -121,6 +96,47 @@ scarb --version and verify that version is >= 2.7.0 +### Rust installation + +> ℹ️ **Info** +> +> `snforge` relies on Scarb's [_procedural macros_](https://github.com/foundry-rs/starknet-foundry/issues/2299) to +> create +`snforge_scarb_plugin` which is a part of `snforge_std`. +> This plugin is required for `snforge` test to work. +> Currently, _procedural macros_ require Rust installation to function. +> This will be changed in the upcoming versions of Scarb. + +> ⚠️ **Warning** +> +> Rust installation is only required if: +> +> * You are using Scarb version <= 2.10.0, *OR* +> * Your platform is not one of the following supported platforms: +> * aarch64-apple-darwin +> * aarch64-unknown-linux-gnu +> * x86_64-apple-darwin +> * x86_64-pc-windows-msvc +> * x86_64-unknown-linux-gnu +> +> It is because precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. + + +```shell +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +To verify that correct Rust version was installed, run + +```shell +rustc --version +``` + +and verify that version is >= 1.80.1 + +See [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details. + + ### Install Starknet Foundry First, add Starknet Foundry plugin to asdf @@ -161,8 +177,26 @@ sncast --version > > If you are using WSL, please follow the [Linux and macOS](#linux-and-macos) guide. +### Install Scarb version >= 2.7.0 + +Follow the instructions from [Scarb docs](https://docs.swmansion.com/scarb/download.html#windows). + +1. Download the release archive matching your CPU architecture + from [https://docs.swmansion.com/scarb/download.html#precompiled-packages](https://docs.swmansion.com/scarb/download.html#precompiled-packages). +2. Extract it to a location where you would like to have Scarb installed. We recommend `%LOCALAPPDATA%\Programs\scarb`. +3. From this directory, get the full path to `scarb\bin` and add it to PATH. + See [this article](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) for instructions on + Windows 10 and 11. + +To verify that Scarb was installed, run + +```shell +scarb --version +``` + +and verify that version is >= 2.7.0 -### Install Rust version >= 1.80.1 +### Rust installation > ℹ️ **Info** > @@ -173,6 +207,21 @@ sncast --version > Currently, _procedural macros_ require Rust installation to function. > This will be changed in the upcoming versions of Scarb. +> ⚠️ **Warning** +> +> Rust installation is only required if: +> +> * You are using Scarb version <= 2.10.0, *OR* +> * Your platform is not one of the following supported platforms: +> * aarch64-apple-darwin +> * aarch64-unknown-linux-gnu +> * x86_64-apple-darwin +> * x86_64-pc-windows-msvc +> * x86_64-unknown-linux-gnu +> +> It is because precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. + + Go to [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) and follow the installation instructions. To verify that correct Rust version was installed, run @@ -185,24 +234,6 @@ and verify that version is >= 1.80.1 See [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details. -### Install Scarb version >= 2.7.0 - -Follow the instructions from [Scarb docs](https://docs.swmansion.com/scarb/download.html#windows). - -1. Download the release archive matching your CPU architecture - from [https://docs.swmansion.com/scarb/download.html#precompiled-packages](https://docs.swmansion.com/scarb/download.html#precompiled-packages). -2. Extract it to a location where you would like to have Scarb installed. We recommend `%LOCALAPPDATA%\Programs\scarb`. -3. From this directory, get the full path to `scarb\bin` and add it to PATH. - See [this article](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) for instructions on - Windows 10 and 11. - -To verify that Scarb was installed, run - -```shell -scarb --version -``` - -and verify that version is >= 2.7.0 ### Install Universal Sierra Compiler From 70e881c8b7687398965423b1aebcb3211838fa89 Mon Sep 17 00:00:00 2001 From: kkawula Date: Fri, 31 Jan 2025 16:48:01 +0100 Subject: [PATCH 26/29] Remove wildcard --- .github/workflows/publish_plugin.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_plugin.yml b/.github/workflows/publish_plugin.yml index 565fd8a5f6..c29d1165d6 100644 --- a/.github/workflows/publish_plugin.yml +++ b/.github/workflows/publish_plugin.yml @@ -38,23 +38,28 @@ jobs: os: ubuntu-latest # Use cross to link oldest GLIBC possible. cross: true + lib-name: "libsnforge_scarb_plugin" ext: "so" - target: aarch64-unknown-linux-gnu os: ubuntu-latest cross: true + lib-name: "libsnforge_scarb_plugin" ext: "so" - target: x86_64-apple-darwin os: macos-latest + lib-name: "libsnforge_scarb_plugin" ext: "dylib" - target: aarch64-apple-darwin os: macos-latest + lib-name: "libsnforge_scarb_plugin" ext: "dylib" - target: x86_64-pc-windows-msvc os: windows-latest + lib-name: "snforge_scarb_plugin" ext: "dll" # The scarb builds for following platforms are experimental and not officially supported by starknet-foundry. @@ -104,10 +109,11 @@ jobs: TARGET="${{ matrix.target }}" EXT="${{ matrix.ext }}" + LIB_NAME="${{ matrix.lib-name }}" OUTPUT_BINARY="${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${EXT}" - mv ./target/${TARGET}/release/*.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} + mv ./target/${TARGET}/release/${LIB_NAME}.${EXT} ./target/${TARGET}/release/${OUTPUT_BINARY} echo "OUTPUT_BINARY_PATH=./target/${TARGET}/release/${OUTPUT_BINARY}" >> $GITHUB_ENV From c589488bf1fc0e35efd83616cb333a7ddac15adc Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 3 Feb 2025 14:09:07 +0100 Subject: [PATCH 27/29] Update installation.md --- docs/src/getting-started/installation.md | 128 ++++++++++------------- 1 file changed, 58 insertions(+), 70 deletions(-) diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index a51bc050a3..8699dfa9b0 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -6,29 +6,31 @@ In this section, we will walk through the process of installing Starknet Foundry ## Contents + * [Installation](#installation) - * [Contents](#contents) - * [Requirements](#requirements) - * [Linux and macOS](#linux-and-macos) - * [Install asdf](#install-asdf) - * [Install Scarb version >= 2.7.0](#install-scarb-version--270) - * [Install Rust version >= 1.80.1](#rust-installation) - * [Install Starknet Foundry](#install-starknet-foundry) - * [Windows](#windows) - * [Install Scarb version >= 2.7.0](#install-scarb-version--270-1) - * [Install Rust version >= 1.80.1](#rust-installation-1) - * [Install Universal Sierra Compiler](#install-universal-sierra-compiler) - * [Install Starknet Foundry](#install-starknet-foundry-1) - * [Common Errors](#common-errors) - * [No Version Set (Linux and macOS Only)](#no-version-set-linux-and-macos-only) - * [Invalid Rust Version](#invalid-rust-version) - * [Linux and macOS](#linux-and-macos-1) - * [Windows](#windows-1) - * [`scarb test` Isn’t Running `snforge`](#scarb-test-isnt-running-snforge) - * [Universal-Sierra-Compiler update](#universal-sierra-compiler-update) - * [Linux and macOS](#linux-and-macos-2) - * [Windows](#windows-2) - * [How to build Starknet Foundry from source code](#how-to-build-starknet-foundry-from-source-code) + * [Contents](#contents) + * [Requirements](#requirements) + * [Linux and macOS](#linux-and-macos) + * [Install asdf](#install-asdf) + * [Install Scarb version >= 2.7.0](#install-scarb-version--270) + * [(Optional for Scarb >= 2.10.0) Rust Installation](#optional-for-scarb--2100note-rust-installation) + * [Install Starknet Foundry](#install-starknet-foundry) + * [Windows](#windows) + * [Install Scarb version >= 2.7.0](#install-scarb-version--270-1) + * [(Optional for Scarb >= 2.10.0) Rust Installation](#optional-for-scarb--2100-rust-installation) + * [Install Universal Sierra Compiler](#install-universal-sierra-compiler) + * [Install Starknet Foundry](#install-starknet-foundry-1) + * [Common Errors](#common-errors) + * [No Version Set (Linux and macOS Only)](#no-version-set-linux-and-macos-only) + * [Invalid Rust Version](#invalid-rust-version) + * [Linux and macOS](#linux-and-macos-1) + * [Windows](#windows-1) + * [`scarb test` Isn’t Running `snforge`](#scarb-test-isnt-running-snforge) + * [Universal-Sierra-Compiler update](#universal-sierra-compiler-update) + * [Linux and macOS](#linux-and-macos-2) + * [Windows](#windows-2) + * [How to build Starknet Foundry from source code](#how-to-build-starknet-foundry-from-source-code) + ## Requirements @@ -42,10 +44,17 @@ To use Starknet Foundry, you need: - [Scarb](https://docs.swmansion.com/scarb/download.html) version >= 2.7.0 - [Universal-Sierra-Compiler](https://github.com/software-mansion/universal-sierra-compiler) -- [Rust](https://www.rust-lang.org/tools/install) version >= 1.80.1 +- _(Optional for Scarb >= 2.10.0)_[^note] [Rust](https://www.rust-lang.org/tools/install) version >= 1.80.1 all installed and added to your `PATH` environment variable. +[^note]: Additionally, your platform must be one of the supported: +* aarch64-apple-darwin +* aarch64-unknown-linux-gnu +* x86_64-apple-darwin +* x86_64-pc-windows-msvc +* x86_64-unknown-linux-gnu + > 📝 **Note** > > `Universal-Sierra-Compiler` will be automatically installed if you use `asdf` or `snfoundryup`. @@ -96,31 +105,24 @@ scarb --version and verify that version is >= 2.7.0 -### Rust installation +### (Optional for Scarb >= 2.10.0)[^note] Rust Installation -> ℹ️ **Info** -> -> `snforge` relies on Scarb's [_procedural macros_](https://github.com/foundry-rs/starknet-foundry/issues/2299) to -> create -`snforge_scarb_plugin` which is a part of `snforge_std`. -> This plugin is required for `snforge` test to work. -> Currently, _procedural macros_ require Rust installation to function. -> This will be changed in the upcoming versions of Scarb. - -> ⚠️ **Warning** +> ℹ️️ **Info** > -> Rust installation is only required if: +> Rust installation is only required if **ANY** of the following is true: > -> * You are using Scarb version <= 2.10.0, *OR* +> * You are using Scarb version <= 2.10.0 > * Your platform is not one of the following supported platforms: -> * aarch64-apple-darwin -> * aarch64-unknown-linux-gnu -> * x86_64-apple-darwin -> * x86_64-pc-windows-msvc -> * x86_64-unknown-linux-gnu -> -> It is because precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. + > + +* aarch64-apple-darwin + +> * aarch64-unknown-linux-gnu + > +* x86_64-apple-darwin + +> * x86_64-unknown-linux-gnu ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh @@ -136,7 +138,6 @@ and verify that version is >= 1.80.1 See [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details. - ### Install Starknet Foundry First, add Starknet Foundry plugin to asdf @@ -172,9 +173,10 @@ sncast --version ## Windows > 🐧 **Info** - WSL (Windows Subsystem for Linux) -> -> Starknet Foundry can be installed natively on Windows, but currently, for smoother experience, it is recommended to use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install). -> +> +> Starknet Foundry can be installed natively on Windows, but currently, for smoother experience, it is recommended to +> use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install). +> > If you are using WSL, please follow the [Linux and macOS](#linux-and-macos) guide. ### Install Scarb version >= 2.7.0 @@ -196,33 +198,18 @@ scarb --version and verify that version is >= 2.7.0 -### Rust installation +### (Optional for Scarb >= 2.10.0)[^note] Rust Installation -> ℹ️ **Info** -> -> `snforge` relies on Scarb's [_procedural macros_](https://github.com/foundry-rs/starknet-foundry/issues/2299) to -> create -`snforge_scarb_plugin` which is a part of `snforge_std`. -> This plugin is required for `snforge` test to work. -> Currently, _procedural macros_ require Rust installation to function. -> This will be changed in the upcoming versions of Scarb. - -> ⚠️ **Warning** +> ℹ️️ **Info** > > Rust installation is only required if: > -> * You are using Scarb version <= 2.10.0, *OR* +> You are using Scarb version <= 2.10.0, *OR* > * Your platform is not one of the following supported platforms: -> * aarch64-apple-darwin -> * aarch64-unknown-linux-gnu -> * x86_64-apple-darwin > * x86_64-pc-windows-msvc -> * x86_64-unknown-linux-gnu -> -> It is because precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. - -Go to [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) and follow the installation instructions. +Go to [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) and follow the installation +instructions. To verify that correct Rust version was installed, run @@ -234,11 +221,11 @@ and verify that version is >= 1.80.1 See [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details. - ### Install Universal Sierra Compiler 1. Download the release archive matching your CPU architecture - from [https://github.com/software-mansion/universal-sierra-compiler/releases/latest](https://github.com/software-mansion/universal-sierra-compiler/releases/latest). Look for package with `windows` + from [https://github.com/software-mansion/universal-sierra-compiler/releases/latest](https://github.com/software-mansion/universal-sierra-compiler/releases/latest). + Look for package with `windows` in the name e.g. `universal-sierra-compiler-v2.3.0-x86_64-pc-windows-msvc.zip`. 2. Extract it to a location where you would like to have Starknet Foundry installed. We recommend @@ -256,7 +243,8 @@ universal-sierra-compiler --version ### Install Starknet Foundry 1. Download the release archive matching your CPU architecture - from [https://github.com/foundry-rs/starknet-foundry/releases/latest](https://github.com/foundry-rs/starknet-foundry/releases/latest). Look for package with `windows` in the name e.g. + from [https://github.com/foundry-rs/starknet-foundry/releases/latest](https://github.com/foundry-rs/starknet-foundry/releases/latest). + Look for package with `windows` in the name e.g. `starknet-foundry-v0.34.0-x86_64-pc-windows-msvc.zip`. 2. Extract it to a location where you would like to have Starknet Foundry installed. We recommend `%LOCALAPPDATA%\Programs\snfoundry`. From 57254be0342d46e7d831bad2b50b8e5553310402 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 3 Feb 2025 14:09:57 +0100 Subject: [PATCH 28/29] Mention scarb version in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c312fe70be..4e3401174c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Rust is no longer required to use `snforge` - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. +- Rust is no longer required to use `snforge` if using Scarb >= 2.10.0 - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. - Added a suggestion for using the `--max-n-steps` flag when the Cairo VM returns the error: `Could not reach the end of the program. RunResources has no remaining steps`. #### Fixed From 3ba9e849ece8a15287c6b2fe2182aba745afcfc6 Mon Sep 17 00:00:00 2001 From: Artur Michalek Date: Mon, 3 Feb 2025 14:10:19 +0100 Subject: [PATCH 29/29] Add note on supported platforms --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3401174c..2464b63c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added -- Rust is no longer required to use `snforge` if using Scarb >= 2.10.0 - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. +- Rust is no longer required to use `snforge` if using Scarb >= 2.10.0 on supported platforms - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions. - Added a suggestion for using the `--max-n-steps` flag when the Cairo VM returns the error: `Could not reach the end of the program. RunResources has no remaining steps`. #### Fixed