Skip to content

Commit 26ee7e6

Browse files
authored
Merge pull request #696 from TheBlueMatt/2020-09-ci-check-commits
Check each commit at least builds in CI
2 parents 343aacc + 4d9532a commit 26ee7e6

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,29 @@ jobs:
7878
token: f421b687-4dc2-4387-ac3d-dc3b2528af57
7979
fail_ci_if_error: true
8080

81+
check_commits:
82+
runs-on: ubuntu-latest
83+
env:
84+
TOOLCHAIN: stable
85+
steps:
86+
- name: Checkout source code
87+
uses: actions/checkout@v2
88+
with:
89+
fetch-depth: 0
90+
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
91+
uses: actions-rs/toolchain@v1
92+
with:
93+
toolchain: ${{ env.TOOLCHAIN }}
94+
override: true
95+
profile: minimal
96+
- name: Fetch full tree and rebase on upstream
97+
run: |
98+
git remote add upstream https://github.com/rust-bitcoin/rust-lightning
99+
git fetch upstream
100+
git rebase upstream/main
101+
- name: For each commit, run cargo check (including in fuzz)
102+
run: ci/check-each-commit.sh upstream/main
103+
81104
fuzz:
82105
runs-on: ubuntu-latest
83106
env:

ci/check-compiles.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -e
3+
set -x
4+
echo Testing $(git log -1 --oneline)
5+
cargo check
6+
cd fuzz && cargo check --features=stdin_fuzz

ci/check-each-commit.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
if [ "$1" = "" ]; then
3+
echo "USAGE: $0 remote/head_branch"
4+
echo "eg $0 upstream/main"
5+
exit 1
6+
fi
7+
8+
set -e
9+
set -x
10+
11+
if [ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]; then
12+
echo "It seems like the current checked-out commit is not based on $1"
13+
exit 1
14+
fi
15+
git rebase --exec ci/check-compiles.sh $1

0 commit comments

Comments
 (0)