Skip to content

Commit 559b10a

Browse files
committed
Check each commit at least builds in CI
1 parent 343aacc commit 559b10a

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
for COMMITHASH in `git log --format=format:%H $UPSTREAM/main...HEAD`; do
14+
git checkout $COMMITHASH
15+
cargo check
16+
cd fuzz && cargo check --features=stdin_fuzz && cd ..
17+
done

0 commit comments

Comments
 (0)