Check each commit at least builds in CI

This commit is contained in:
Matt Corallo 2020-09-15 14:39:44 -04:00
parent 343aacc50c
commit 4d9532a165
3 changed files with 44 additions and 0 deletions

View file

@ -78,6 +78,29 @@ jobs:
token: f421b687-4dc2-4387-ac3d-dc3b2528af57
fail_ci_if_error: true
check_commits:
runs-on: ubuntu-latest
env:
TOOLCHAIN: stable
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.TOOLCHAIN }}
override: true
profile: minimal
- name: Fetch full tree and rebase on upstream
run: |
git remote add upstream https://github.com/rust-bitcoin/rust-lightning
git fetch upstream
git rebase upstream/main
- name: For each commit, run cargo check (including in fuzz)
run: ci/check-each-commit.sh upstream/main
fuzz:
runs-on: ubuntu-latest
env:

6
ci/check-compiles.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
set -e
set -x
echo Testing $(git log -1 --oneline)
cargo check
cd fuzz && cargo check --features=stdin_fuzz

15
ci/check-each-commit.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
if [ "$1" = "" ]; then
echo "USAGE: $0 remote/head_branch"
echo "eg $0 upstream/main"
exit 1
fi
set -e
set -x
if [ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]; then
echo "It seems like the current checked-out commit is not based on $1"
exit 1
fi
git rebase --exec ci/check-compiles.sh $1