aboutsummaryrefslogtreecommitdiff
path: root/.run_formal_checks.sh
diff options
context:
space:
mode:
authorJack Koenig2021-01-19 11:51:33 -0800
committerGitHub2021-01-19 11:51:33 -0800
commitbbd7fc4115728ecc7cf88bf0524f2126d8220c34 (patch)
tree1d49d377c0da72490f70a2dbcc9e6a4881b0d7d1 /.run_formal_checks.sh
parent15013df6f6ac2dafeb35d7ed15cf95c7ac8a5bef (diff)
Switch from Travis to Github Actions CI (#2041)
* Fix .run_formal_checks for Github Actions instead of Travis * Remove .run_chisel_tests Because we publish SNAPSHOTs on every merge to master, the Chisel repo checks against master of FIRRTL regularly * Only run unidoc for Scala 2.12 Under Travis we ran for 2.11, 2.12, and 2.13, but it doesn't work when using ++2.<major>.<minor> when major != to 2.12. It seems if we want to run all 3, we have to run as `sbt +unidoc`. It's not clear how much benefit we get from building on the other versions, so stick with 2.12 for now. * Generate .mergify.yml with script in chisel-repo-tools Generated with config: conditions: - status-success=all tests passed branches: - 1.2.x - 1.3.x - 1.4.x
Diffstat (limited to '.run_formal_checks.sh')
-rwxr-xr-x.run_formal_checks.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/.run_formal_checks.sh b/.run_formal_checks.sh
index f5ffec25..0a28a1d1 100755
--- a/.run_formal_checks.sh
+++ b/.run_formal_checks.sh
@@ -11,23 +11,25 @@ fi
DUT=$1
-# Run formal check only for PRs
-if [ $TRAVIS_PULL_REQUEST = "false" ]; then
- echo "Not a pull request, no formal check"
- exit 0
-else
- # $TRAVIS_BRANCH is branch targeted by PR
- # Travis does a shallow clone, checkout PR target so that we have it
- # THen return to previous branch so HEAD points to the commit we're testing
- git remote set-branches origin $TRAVIS_BRANCH && git fetch
- git checkout $TRAVIS_BRANCH
+# See https://docs.github.com/en/actions/reference/environment-variables
+# for info about these variables
+
+# Run formal check only for PRs, GITHUB_BASE_REF is only set for PRs
+if [ ! -z "$GITHUB_BASE_REF" ]; then
+ # Github Actions does a shallow clone, checkout PR target so that we have it
+ # Then return to previous branch so HEAD points to the commit we're testing
+ git remote set-branches origin $GITHUB_BASE_REF && git fetch
+ git checkout $GITHUB_BASE_REF
git checkout -
# Skip if '[skip formal checks]' shows up in any of the commit messages in the PR
- if git log --format=%B --no-merges $TRAVIS_BRANCH..HEAD | grep '\[skip formal checks\]'; then
+ if git log --format=%B --no-merges $GITHUB_BASE_REF..HEAD | grep '\[skip formal checks\]'; then
echo "Commit message says to skip formal checks"
exit 0
else
cp regress/$DUT.fir $DUT.fir
- ./scripts/formal_equiv.sh HEAD $TRAVIS_BRANCH $DUT
+ ./scripts/formal_equiv.sh HEAD $GITHUB_BASE_REF $DUT
fi
+else
+ echo "Not a pull request, no formal check"
+ exit 0
fi