Bump the actions group with 4 updates #10
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
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 }}" | |
} |