Skip to content

Commit 8434d06

Browse files
committed
Check each commit at least builds in CI
1 parent 343aacc commit 8434d06

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-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
103+
81104
fuzz:
82105
runs-on: ubuntu-latest
83106
env:

ci/check-each-commit.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
set -e
3+
for REMOTE in `git remote`; do
4+
if [ "$(git remote show $REMOTE | grep "^ Fetch URL: .*github.com\(:\|/\)rust-bitcoin/rust-lightning")" != "" ]; then
5+
UPSTREAM=$REMOTE
6+
break
7+
fi
8+
done
9+
if [ "$UPSTREAM" = "" ]; then
10+
echo "Failed to find a remote set to github.com/rust-bitcoin/rust-lightning"
11+
exit 1
12+
fi
13+
if [ "$(git log | grep "^commit [0-9a-f]* (.*upstream/main.*)$")" = "" ]; then
14+
echo "It seems like the current checked-out commit is not based on the latest usptream commit"
15+
exit 1
16+
fi
17+
git rebase $UPSTREAM/main
18+
for COMMITHASH in `git log --format=format:%H $UPSTREAM/main...HEAD`; do
19+
git checkout $COMMITHASH
20+
cargo check
21+
cd fuzz && cargo check --features=stdin_fuzz && cd ..
22+
done

0 commit comments

Comments
 (0)