Skip to content

Commit

Permalink
Make workflow reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Jul 25, 2024
1 parent 185e28f commit e21e5f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/verify-std-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# Changes unrelated to the toolchain should match the current status of main.

name: Check Std Verification
on: pull_request
on:
pull_request:
workflow_call:

env:
RUST_BACKTRACE: 1
Expand Down Expand Up @@ -61,23 +63,23 @@ jobs:
# If the head failed, check if it's a new failure.
- name: Checkout base
working-directory: kani
if: steps.check-head.outcome != 'success'
if: steps.check-head.outcome != 'success' && github.event_name == 'pull_request'
run: |
BASE_REF=${{ github.event.pull_request.base.sha }}
git checkout ${BASE_REF}
cargo build-dev
- name: Run verification with BASE
id: check-base
if: steps.check-head.outcome != 'success'
if: steps.check-head.outcome != 'success' && github.event_name == 'pull_request'
working-directory: verify-rust-std
continue-on-error: true
run: |
kani verify-std -Z unstable-options ./library --target-dir ${{ runner.temp }} -Z function-contracts \
-Z mem-predicates -Z ptr-to-ref-cast-checks
- name: Compare results
if: steps.check-head.outcome != 'success' && steps.check-base.output == 'success'
- name: Compare PR results
if: steps.check-head.outcome != 'success' && steps.check-head.output != github.check-base.output
run: |
echo "New failure introduced by this change"
exit 1
Expand Down

0 comments on commit e21e5f6

Please sign in to comment.