Skip to content

Configure --network providers in snfoundry.toml #17748

Configure --network providers in snfoundry.toml

Configure --network providers in snfoundry.toml #17748

Workflow file for this run

name: CI
on:
pull_request:
merge_group:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-forge-unit:
name: Test Forge / Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- run: cargo test --profile ci --lib -p forge
build-test-forge-nextest-archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
setup-scarb: 'false'
setup-usc: 'false'
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Build and archive tests
run: cargo nextest archive --cargo-profile ci -p forge --archive-file 'nextest-archive-${{ runner.os }}.tar.zst'
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive-${{ runner.os }}
path: nextest-archive-${{ runner.os }}.tar.zst
build-test-forge-nextest-archive-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
install-llvm: 'true'
setup-scarb: 'false'
setup-usc: 'false'
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Build and archive tests
run: cargo nextest archive --cargo-profile ci -p forge --features cairo-native --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst'
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive-${{ runner.os }}-native
path: nextest-archive-${{ runner.os }}-native.tar.zst
test-forge-integration:
name: Test Forge / Integration Tests
runs-on: [ ubuntu-latest ]
needs: [ build-test-forge-nextest-archive ]
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3 ]
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- uses: actions/download-artifact@v4
with:
name: nextest-archive-${{ runner.os }}
- name: nextest partition ${{ matrix.partition }}/3
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}.tar.zst' integration
test-forge-integration-native:
name: Test Forge / Integration Tests (native)
runs-on: [ ubuntu-latest ]
needs: [ build-test-forge-nextest-archive-native ]
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3 ]
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- uses: actions/download-artifact@v4
with:
name: nextest-archive-${{ runner.os }}-native
- name: nextest partition ${{ matrix.partition }}/3
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst' integration
test-forge-e2e:
name: Test Forge / E2E Tests
runs-on: ubuntu-latest
needs: [ build-test-forge-nextest-archive ]
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3 ]
steps:
- name: Extract branch name
if: github.event_name != 'pull_request'
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
shell: bash
- name: Extract branch name on pull request
if: github.event_name == 'pull_request'
run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
shell: bash
- name: Extract repo name and owner
if: github.event_name != 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV
shell: bash
- name: Extract repo name and owner on pull request
if: github.event_name == 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)" >> $GITHUB_ENV
shell: bash
- name: Install cairo-profiler
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh
- name: Install cairo-coverage
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
- uses: actions/checkout@v5
- uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
- uses: ./.github/actions/setup-tools
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- uses: actions/download-artifact@v4
with:
name: nextest-archive-${{ runner.os }}
- name: nextest partition ${{ matrix.partition }}/3
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}.tar.zst' e2e
test-forge-e2e-native:
name: Test Forge / E2E Tests (native)
runs-on: ubuntu-latest
needs: [ build-test-forge-nextest-archive-native ]
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3 ]
steps:
- name: Extract branch name
if: github.event_name != 'pull_request'
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
shell: bash
- name: Extract branch name on pull request
if: github.event_name == 'pull_request'
run: echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
shell: bash
- name: Extract repo name and owner
if: github.event_name != 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.repository }}.git)" >> $GITHUB_ENV
shell: bash
- name: Extract repo name and owner on pull request
if: github.event_name == 'pull_request'
run: echo "REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)" >> $GITHUB_ENV
shell: bash
- name: Install cairo-profiler
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh
- name: Install cairo-coverage
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
- uses: actions/checkout@v5
- uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
- uses: ./.github/actions/setup-tools
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- uses: actions/download-artifact@v4
with:
name: nextest-archive-${{ runner.os }}-native
- name: nextest partition ${{ matrix.partition }}/3
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst' e2e
test-plugin-checks:
name: Test plugin across different scarb versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
# No setup scarb action is used because we want to install multiple versions of scarb through asdf
with:
setup-scarb: 'false'
- uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
- run: cargo test --profile ci --package forge --features test_for_multiple_scarb_versions e2e::plugin_diagnostic
test-requirements-check-special-conditions:
name: Test requirements check special conditions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
setup-scarb: 'false'
- run: cargo test --profile ci --package forge --features no_scarb_installed --lib compatibility_check::tests::failing_tool_not_installed
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.10.0"
- run: cargo test --profile ci --package forge --features scarb_2_10_0 --test main e2e::requirements::test_warning_on_scarb_version_below_recommended
test-forge-runner:
name: Test Forge Runner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- run: cargo test --profile ci -p forge_runner
test-cheatnet:
name: Test Cheatnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- name: Run Cheatnet tests
run: cargo test --profile ci -p cheatnet
test-data-transformer:
name: Test Data Transformer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- name: Run Data Transformer tests
run: cargo test --profile ci -p data-transformer
test-forge-scarb-plugin:
name: Test Forge Scarb Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- name: Run Forge Scarb Plugin tests
working-directory: crates/snforge-scarb-plugin
run: cargo test --profile ci
test-forge-scarb-plugin-deprecated:
name: Test Forge Scarb Plugin Deprecated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- name: Run Forge Scarb Plugin tests
working-directory: crates/snforge-scarb-plugin-deprecated
run: cargo test --profile ci
test-cast:
name: Test Cast
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
- uses: ./.github/actions/setup-tools
- name: Run tests
run: cargo test --profile ci -p sncast
test-conversions:
name: Test Conversions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
setup-scarb: 'false'
setup-usc: 'false'
- name: Run tests
run: cargo test --profile ci -p conversions
test-shared:
name: Test Shared
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
setup-scarb: 'false'
setup-usc: 'false'
- run: cargo test --profile ci -p shared
test-scarb-api:
name: Test Scarb Api
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- run: cargo test --profile ci -p scarb-api
scarbfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: software-mansion/setup-scarb@v1
- name: Check cairo files format
run: |
output=$(find . -type f -name "Scarb.toml" -not -path "*/snforge_std_deprecated/*" -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@v5
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
- name: Check formatting
run: cargo fmt --check
- name: Check formatting snforge-scarb-plugin
run: cargo fmt --check
working-directory: crates/snforge-scarb-plugin
- name: Check formatting snforge-scarb-plugin-deprecated
run: cargo fmt --check
working-directory: crates/snforge-scarb-plugin-deprecated
clippy:
runs-on: ubuntu-latest
env:
# Make sure CI fails on all warnings - including Clippy lints.
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
with:
install-llvm: 'true'
setup-scarb: 'false'
setup-usc: 'false'
- run: cargo lint
- name: Lint snforge-scarb-plugin
run: cargo lint
working-directory: crates/snforge-scarb-plugin
- name: Lint snforge-scarb-plugin-deprecated
run: cargo lint
working-directory: crates/snforge-scarb-plugin-deprecated
build-docs:
name: Test Building Docs
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.52
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-tools
- name: Install mdBook
run: |
cargo install --version ${MDBOOK_VERSION} mdbook
cargo install mdbook-variables
- 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@v5
- name: typos-action
uses: crate-ci/[email protected]