Run script/mirror verify on GitHub Actions too

* So the shasums are checked in PRs.
This commit is contained in:
Benoit Daloze 2021-07-07 19:53:47 +02:00
parent 25e52813b6
commit 964e83a039
2 changed files with 12 additions and 3 deletions

View file

@ -11,5 +11,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: git clone --depth 1 https://github.com/sstephenson/bats.git
- run: PATH="./bats/bin:$PATH" script/test
env:
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}

View file

@ -1,13 +1,18 @@
#!/usr/bin/env bash
set -e
set -x
STATUS=0
bats ${CI:+--tap} test || STATUS="$?"
if [ -n "$TRAVIS_COMMIT_RANGE" ]; then
COMMIT_RANGE="$TRAVIS_COMMIT_RANGE"
fi
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then
./script/mirror update "$TRAVIS_COMMIT_RANGE"
elif [ "${TRAVIS_PULL_REQUEST:-false}" != "false" ]; then
./script/mirror verify "$TRAVIS_COMMIT_RANGE"
./script/mirror update "$COMMIT_RANGE"
elif [ "${TRAVIS_PULL_REQUEST:-false}" != "false" ] || [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
./script/mirror verify "$COMMIT_RANGE"
fi
exit "$STATUS"