chore(ffi): run gen_header.sh in CI environment (#2488)

Clean up the script so that any unexpected error terminates the
script, and stop suppressing errors that may contain useful
information (for example, that you are using the stable version but
need to use the nightly).

This is useful because if hyper.h is not up to date going forward the
CI should flag it. As is, there are a bunch of changes to hyper.h that
have not been checked in (or were generated by a newer version of the
cbindgen script.)

Fixes #2483.
This commit is contained in:
Kevin Burke
2021-04-06 14:46:14 -07:00
committed by GitHub
parent c7ab1aace1
commit a5464f761a
4 changed files with 241 additions and 98 deletions

View File

@@ -17,6 +17,7 @@ jobs:
- test
- features
- ffi
- ffi-header
- doc
steps:
- run: exit 0
@@ -119,9 +120,7 @@ jobs:
ffi:
name: Test C API (FFI)
needs: [style]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
@@ -147,10 +146,6 @@ jobs:
command: build
args: --features client,http1,http2,ffi
# TODO: re-enable check once figuring out how to get it working in CI
# - name: Verify cbindgen
# run: ./capi/gen_header.sh --verify
- name: Make Examples
run: cd capi/examples && make client
@@ -162,6 +157,39 @@ jobs:
command: test
args: --features full,ffi --lib
ffi-header:
name: Verify hyper.h is up to date
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
override: true
components: cargo
- name: Install cbindgen
uses: actions-rs/cargo@v1
with:
command: install
args: cbindgen
- name: Build FFI
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: --cfg hyper_unstable_ffi
with:
command: build
args: --features client,http1,http2,ffi
- name: Ensure that hyper.h is up to date
run: ./capi/gen_header.sh --verify
doc:
name: Build docs
needs: [style, test]