Skip to content

Commit

Permalink
Respond to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Nov 28, 2023
1 parent cd78f11 commit 4161fe7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/cbmc-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,37 @@ jobs:
with:
os: ubuntu-22.04

- name: Compare CBMC versions
- name: Compare CBMC versions and determine next step
env:
GH_TOKEN: ${{ github.token }}
run: |
grep ^CBMC_VERSION kani-dependencies >> $GITHUB_ENV
CBMC_LATEST=$(gh -R diffblue/cbmc release list | grep Latest | awk '{print $1}' | cut -f2 -d-)
echo "CBMC_LATEST=$CBMC_LATEST" >> $GITHUB_ENV
# check whether the version has changed at all
if [ x$CBMC_LATEST = x$CBMC_VERSION ] ; then
echo "next_step=none" >> $GITHUB_ENV
# check whether we already have an existing issue for a failing
# upgrade
elif gh issue list -S \
"CBMC upgrade to $CBMC_LATEST failed" \
--json number,title | grep title ; then
echo "next_step=none" >> $GITHUB_ENV
# check whether we already have a branch (and thus: a PR) for a
# successful upgrade
elif ! git ls-remote --exit-code origin cbmc-$CBMC_LATEST ; then
CBMC_LATEST_MAJOR=$(echo $CBMC_LATEST | cut -f1 -d.)
CBMC_LATEST_MINOR=$(echo $CBMC_LATEST | cut -f2 -d.)
sed -i "s/^CBMC_MAJOR=.*/CBMC_MAJOR=\"$CBMC_MAJOR\"/" kani-dependencies
sed -i "s/^CBMC_MINOR=.*/CBMC_MINOR=\"$CBMC_MINOR\"/" kani-dependencies
sed -i "s/^CBMC_VERSION=.*/CBMC_VERSION=\"$CBMC_LATEST\"/" kani-dependencies
git diff
if ! cargo build-dev ; then
echo "next_step=create_issue" >> $GITHUB_ENV
elif ! ./scripts/kani-regression.sh ; then
if ! ./scripts/kani-regression.sh ; then
echo "next_step=create_issue" >> $GITHUB_ENV
else
echo "next_step=create_pr" >> $GITHUB_ENV
fi
# we already have a PR, nothing to be done
else
echo "next_step=none" >> $GITHUB_ENV
fi
Expand Down

0 comments on commit 4161fe7

Please sign in to comment.