From: Matt Corallo Date: Tue, 15 Sep 2020 18:39:44 +0000 (-0400) Subject: Check each commit at least builds in CI X-Git-Tag: v0.0.12~26^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2020-09-ci-check-commits;p=rust-lightning Check each commit at least builds in CI --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95372d729..d75607a18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/ci/check-compiles.sh b/ci/check-compiles.sh new file mode 100755 index 000000000..177765fb9 --- /dev/null +++ b/ci/check-compiles.sh @@ -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 diff --git a/ci/check-each-commit.sh b/ci/check-each-commit.sh new file mode 100755 index 000000000..e4723c837 --- /dev/null +++ b/ci/check-each-commit.sh @@ -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