Support starknet_getBlockWithTxs
#645
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Checks | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # TODO: Remove below env once stable release of starknet foundry is available | |
| SNFOUNDRY_SHA: 3d227d0aa6bf896f912144088f3c7bf0424f4c13 | |
| jobs: | |
| test_and_lint: | |
| runs-on: macos-15 | |
| env: | |
| DEVNET_SHA: aafa74e4297734bacba72d0faa7c711eacecfc7a # v0.5.0-rc.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Xcode | |
| uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
| with: | |
| xcode-version: '16.2.0' | |
| - name: Cache/Restore Mint packages | |
| id: mint-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/mint | |
| key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} | |
| restore-keys: ${{ runner.os }}-mint- | |
| - name: Check if Mint is installed | |
| id: mint-installed | |
| run: brew list | grep mint | |
| continue-on-error: true | |
| - name: Upgrade package manager "Mint" | |
| if: steps.mint-installed.outcome == 'success' | |
| run: | | |
| brew upgrade mint | |
| - name: Install package manager "Mint" | |
| if: steps.mint-installed.outcome != 'success' | |
| run: | | |
| brew install mint | |
| - name: Install command line tool (if not yet cached) | |
| if: steps.mint-cache.outputs.cache-hit != 'true' | |
| run: mint bootstrap | |
| - name: Run SwiftFormat lint | |
| run: mint run swiftformat --lint . | |
| # TODO: Replace with installing release when release is available | |
| - name: Clone starknet-devnet-rs | |
| run: | | |
| git clone https://github.com/0xSpaceShard/starknet-devnet-rs.git starknet-devnet-rs | |
| pushd ${{ github.workspace }}/starknet-devnet-rs | |
| git checkout ${{ env.DEVNET_SHA }} | |
| popd | |
| - name: Cache devnet build | |
| uses: actions/cache@v4 | |
| with: | |
| path: starknet-devnet-rs/target/release | |
| key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ env.DEVNET_SHA }} | |
| - name: Build devnet | |
| run: | | |
| if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| pushd ${{ github.workspace }}/starknet-devnet-rs | |
| cargo build --release | |
| popd | |
| else | |
| echo "Found existing starknet-devnet-rs build, skipping compilation." | |
| fi | |
| - name: Setup scarb 0.7.0 | |
| uses: software-mansion/[email protected] | |
| with: | |
| scarb-version: "0.7.0" | |
| # TODO(#226) | |
| - name: Fetch latest asdf version from GitHub releases | |
| id: asdf_version | |
| run: | | |
| latest_version=$(curl -sS --fail -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/asdf-vm/asdf/releases/latest | grep \"tag_name\": | awk '{print $2}' | tr -d 'v",') | |
| echo "Latest asdf version found is $latest_version" | |
| echo "LATEST=$latest_version" >> $GITHUB_ENV | |
| - name: Setup asdf | |
| run: | | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| ASDF_PLATFORM="linux-amd64" | |
| else | |
| ASDF_PLATFORM="darwin-arm64" | |
| fi | |
| mkdir -p "$HOME/.local/bin" | |
| DOWNLOAD_URL="https://github.com/asdf-vm/asdf/releases/download/v${LATEST}/asdf-v${LATEST}-${ASDF_PLATFORM}.tar.gz" | |
| echo "Downloading asdf from $DOWNLOAD_URL" | |
| curl -fsSL "$DOWNLOAD_URL" | tar xzf - -C "$HOME/.local/bin" | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| echo "${ASDF_DATA_DIR:-$HOME/.asdf}/shims" >> $GITHUB_PATH | |
| - name: Install starknet-foundry | |
| # TODO: Use below steps once stable release of starknet foundry is available | |
| # run: | | |
| # asdf plugin add starknet-foundry | |
| # asdf install starknet-foundry 0.40.0 | |
| # asdf set starknet-foundry 0.40.0 --home | |
| run: | | |
| DOWNLOAD_URL="https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/snfoundryup" | |
| curl -s "$DOWNLOAD_URL" | bash -s -- -c ${{ env.SNFOUNDRY_SHA }} | |
| - name: Check Cairo contracts formatting | |
| working-directory: ./Tests/StarknetTests/Resources/Contracts/src | |
| run: scarb fmt --check | |
| - name: Run tests | |
| run: | | |
| export DEVNET_PATH=${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet | |
| export SCARB_PATH="$(which scarb)" | |
| export SNCAST_PATH="$(which sncast)" | |
| swift test --disable-sandbox |