Skip to content

Commit 52e92bc

Browse files
sorafujitanikddnewton
authored andcommitted
Check pregenerated bindings freshness and portability in CI
The sys-bindings job regenerates the bindings and fails if the committed file is stale. The test matrix also runs the layout tests via buildtime_bindgen on 64-bit hosts and checks that the committed bindings compile for wasm32-wasip1.
1 parent d848614 commit 52e92bc

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/rust-bindings.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,40 @@ jobs:
4747
- name: Run tests
4848
run: bundle exec rake cargo:test
4949

50+
- name: Run tests with buildtime_bindgen
51+
run: cargo test --features buildtime_bindgen -- --nocapture
52+
working-directory: rust/ruby-prism-sys
53+
54+
- name: Check pregenerated bindings on wasm32-wasip1
55+
if: ${{ matrix.os == 'ubuntu-latest' }}
56+
run: cargo check --target wasm32-wasip1 --no-default-features
57+
working-directory: rust/ruby-prism-sys
58+
env:
59+
PRISM_LIB_DIR: "."
60+
5061
- name: Run examples
5162
if: ${{ matrix.os != 'windows-latest' }}
5263
run: bundle exec rake cargo:examples
5364

65+
sys-bindings:
66+
name: cargo:bindings
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v7
70+
- name: Set up Ruby
71+
uses: ruby/setup-ruby@v1
72+
with:
73+
ruby-version: ruby
74+
bundler-cache: true
75+
- name: Set up Rust
76+
uses: dtolnay/rust-toolchain@master
77+
with:
78+
toolchain: "1.91.1"
79+
- name: rake cargo:bindings
80+
run: bundle exec rake cargo:bindings
81+
- name: Check that the pregenerated bindings are up to date
82+
run: git diff --color --no-ext-diff --exit-code -- rust/ruby-prism-sys/src/bindings.rs
83+
5484
lint:
5585
name: cargo:lint
5686
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)