From fb1929fec460d390b03f641092cd8a333563e9eb Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Fri, 23 Feb 2024 05:56:16 -0800 Subject: [PATCH] [ci] Automatically roll pinned Kani version Makes progress on #929 --- .../roll-pinned-toolchain-versions.yml | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/roll-pinned-toolchain-versions.yml b/.github/workflows/roll-pinned-toolchain-versions.yml index b0ca0695f5..46a6f8e3b6 100644 --- a/.github/workflows/roll-pinned-toolchain-versions.yml +++ b/.github/workflows/roll-pinned-toolchain-versions.yml @@ -17,7 +17,7 @@ on: permissions: read-all jobs: - roll: + roll_rust: runs-on: ubuntu-latest strategy: matrix: @@ -105,3 +105,31 @@ jobs: branch: roll-pinned-${{ matrix.toolchain }}-toolchain-to-${{ env.ZC_VERSION_FOR_BRANCH_NAME }} push-to-fork: google-pr-creation-bot/zerocopy token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }} + roll_kani: + runs-on: ubuntu-latest + name: Roll pinned Kani version + steps: + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: main + persist-credentials: false + - run: | + set -xeo pipefail + + cargo add --dry-run kani-verifier + KANI_LATEST=$(cargo add --dry-run kani-verifier 2>&1 | grep -oh '[0-9]\+\.[0-9]\+\.[0-9]\+') + echo "ZC_KANI_LATEST=$KANI_LATEST" >> $GITHUB_ENV + + # Update the `kani-version:` argument in-place. + sed -i -E -e "s/^( *kani-version:)( [0-9]+\.[0-9]+\.[0-9]+)/\1 $KANI_LATEST/" .github/workflows/ci.yml + - name: Submit PR + uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 + with: + commit-message: "[ci] Roll pinned Kani version" + author: Google PR Creation Bot + committer: Google PR Creation Bot + title: "[ci] Roll pinned Kani version" + branch: roll-pinned-kani-to-${{ env.ZC_KANI_LATEST }} + push-to-fork: google-pr-creation-bot/zerocopy + token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}