-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Abeeujah/starknet-foundry
- Loading branch information
Showing
267 changed files
with
3,459 additions
and
813 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish snforge_scarb_plugin | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
upload-to-registry: | ||
name: Upload plugin to the registry | ||
runs-on: ubuntu-latest | ||
env: | ||
SCARB_REGISTRY_AUTH_TOKEN: ${{ secrets.SCARB_REGISTRY_AUTH_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check version | ||
id: check-version | ||
if: ${{ github.event_name != 'workflow_dispatch' }} | ||
run: | | ||
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 | ||
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a | ||
with: | ||
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' }} | ||
working-directory: crates/snforge-scarb-plugin | ||
run: scarb publish |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Scheduled | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- scripts/get_scarb_versions.sh | ||
- .github/workflows/scheduled.yml | ||
schedule: | ||
- cron: '0 0 * * 3,0' | ||
|
||
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/[email protected] | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SCHEDULED_TESTS_FAILURE_WEBHOOK_URL }} | ||
with: | ||
payload: | | ||
{ | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} |
This file contains 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
Oops, something went wrong.