Skip to content

Cairo Update Check #343

Cairo Update Check

Cairo Update Check #343

name: Cairo Update Check
on:
workflow_dispatch:
inputs:
no_slack:
description: "Skip sending Slack notification on failure"
type: boolean
default: false
schedule:
- cron: "0 0 * * 1-5"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-test:
name: build tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: software-mansion/setup-scarb@v1
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- 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::Checking Cairo commit: https://github.com/starkware-libs/cairo/commit/$CAIRO_REV"
cargo xtask upgrade cairo --rev "$CAIRO_REV"
- name: Upgrade Lint to latest main commit
run: |
LINT_REV=$(git ls-remote --refs "https://github.com/software-mansion/cairo-lint" main | awk '{print $1}')
echo "::notice::Checking Lint commit: https://github.com/software-mansion/cairo-lint/$LINT_REV"
cargo xtask upgrade cairolint --rev "$LINT_REV"
- name: nextest archive
run: cargo nextest archive --workspace --all-features --cargo-profile ci --archive-file 'nextest-archive.tar.zst'
- uses: actions/upload-artifact@v6
with:
name: nextest-archive
path: nextest-archive.tar.zst
test:
name: test ${{ matrix.partition }}/6
runs-on: ubuntu-latest
needs:
- build-test
strategy:
fail-fast: false
matrix:
partition: [ 1, 2, 3, 4, 5, 6 ]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: nightly
cache: false
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- uses: actions/download-artifact@v7
with:
name: nextest-archive
- name: nextest partition ${{ matrix.partition }}/6
run: cargo nextest run --profile ci --partition 'count:${{ matrix.partition }}/6' --archive-file 'nextest-archive.tar.zst'
notify_failed:
runs-on: ubuntu-latest
if: failure() && !(inputs.no_slack)
needs: [ build-test, test ]
steps:
- name: Notify the team about workflow failure
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_CAIRO_UPDATE_CHECK_FAILURE_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"