From 4d9532a1651d85683a91423912d0b1d47f02f7e2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 15 Sep 2020 14:39:44 -0400 Subject: [PATCH] Check each commit at least builds in CI --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ ci/check-compiles.sh | 6 ++++++ ci/check-each-commit.sh | 15 +++++++++++++++ 3 files changed, 44 insertions(+) create mode 100755 ci/check-compiles.sh create mode 100755 ci/check-each-commit.sh 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 -- 2.39.5