Skip to content

Commit

Permalink
Add CI run for bindings generation (though we'll allow it to fail)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed May 16, 2020
1 parent 0aa2422 commit 3c85f1a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ jobs:
include:
- toolchain: stable
build-net-tokio: true
build-bindings: true
- toolchain: beta
build-net-tokio: true
build-bindings: true
- toolchain: 1.39.0
build-net-tokio: true
build-bindings: true
coverage: true
- toolchain: 1.34.2
build-bindings: true
runs-on: ubuntu-latest
steps:
- name: Checkout source code
Expand All @@ -38,6 +43,9 @@ jobs:
- name: Build on Rust ${{ matrix.toolchain }}
if: "! matrix.build-net-tokio"
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
- name: Build bindings on Rust ${{ matrix.toolchain }}
if: matrix.build-bindings
run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning-c-bindings
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio
if: matrix.build-net-tokio
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
Expand Down Expand Up @@ -94,3 +102,33 @@ jobs:
run: cd fuzz && cargo test --verbose --color always
- name: Run fuzzers
run: cd fuzz && ./ci-fuzz.sh

check_bindings:
runs-on: ubuntu-latest
env:
TOOLCHAIN: stable
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.TOOLCHAIN }}
override: true
profile: minimal
- name: Install cbindgen
run: cargo install --force cbindgen
- name: Rebuild bindings, and check the sample app builds + links
run: ./genbindings.sh
- name: Check that the latest bindings are in git
run: |
if [ "$(git diff)" != "" ]; then
git diff
# cbindgen's bindings output order can be FS-dependant, so check that the lines are all the same:
mv lightning-c-bindings/include/lightning.h lightning-c-bindings/include/lightning.h.new
git checkout lightning-c-bindings/include/lightning.h
cat lightning-c-bindings/include/lightning.h | sort > lightning-c-bindings/include/lightning.h.sorted
cat lightning-c-bindings/include/lightning.h.new | sort > lightning-c-bindings/include/lightning.h.new.sorted
[ "$(diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted)" != "" ] && exit 2
[ "$(git diff)" != "" ] && exit 1
fi

0 comments on commit 3c85f1a

Please sign in to comment.