Skip to content

Commit

Permalink
Add Cairo update check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaput committed Dec 2, 2024
1 parent 68452cd commit f757be9
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/cairo-update-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Cairo Update Check

on:
push: # TODO this is just for testing
workflow_dispatch:
inputs:
slack:
description: "Send Slack notification on failure"
type: boolean
default: true
schedule:
- cron: '0 0 * * *'

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: software-mansion/setup-scarb@v1

- name: Build xtasks
run: cargo build -p xtask

- name: Upgrade Cairo to latest main commit
run: |
CAIRO_REV=$(git ls-remote --refs "https://github.com/starkware-libs/cairo" main | awk '{print $1}')
echo "::notice::https://github.com/starkware-libs/cairo/commit/$CAIRO_REV"
cargo xtask set-cairo-version --rev "$CAIRO_REV"
- run: cargo test --profile=ci --no-fail-fast

notify_failed:
runs-on: ubuntu-latest
if: always() && !(inputs.slack) && needs.check.result == 'failure'
needs: check
steps:
- name: Notify the team about workflow failure
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CAIRO_UPDATE_CHECK_FAILURE_WEBHOOK_URL }}
with:
payload: |
{
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}

0 comments on commit f757be9

Please sign in to comment.