diff --git a/.github/release-matrix.json b/.github/release-matrix.json new file mode 100644 index 00000000..dc6744b1 --- /dev/null +++ b/.github/release-matrix.json @@ -0,0 +1,12 @@ +{ + "supported-ruby-platforms": [ + "aarch64-linux", + "aarch64-linux-musl", + "arm64-darwin", + "x64-mingw-ucrt", + "x86_64-darwin", + "x86_64-linux", + "x86_64-linux-musl" + ], + "stable-ruby-versions": ["3.2", "3.3", "3.4"] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35787c9b..a9693cca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,18 +13,12 @@ env: RSPEC_FORMATTER: doc jobs: + # Test the Ruby versions pinned in `.github/release-matrix.json`, resolved the + # same way as for releases. ci-data: - runs-on: ubuntu-latest - outputs: - result: ${{ steps.fetch.outputs.result }} - steps: - - id: fetch - uses: oxidize-rb/actions/fetch-ci-data@v1 - with: - stable-ruby-versions: | - # See https://github.com/bytecodealliance/wasmtime-rb/issues/286 - # for details. - exclude: [head] + uses: bytecodealliance/wasmtime-rb/.github/workflows/native-gem-matrix.yml@main + with: + snapshot: true ci: runs-on: ${{ matrix.os }} diff --git a/ext/src/ruby_api/component/convert.rs b/ext/src/ruby_api/component/convert.rs index 2b128bc6..f0bdf620 100644 --- a/ext/src/ruby_api/component/convert.rs +++ b/ext/src/ruby_api/component/convert.rs @@ -211,7 +211,7 @@ pub(crate) fn rb_to_component_val( let payload_val = match (&case.ty, payload_rb.is_nil()) { (Some(ty), _) => rb_to_component_val(payload_rb, _store, ty) .map(|val| Some(Box::new(val))) - .map_err(|e| e.append(format!(" (variant value for \"{}\")", &name))), + .map_err(|e| e.append(format!(" (variant value for \"{}\")", name))), // case doesn't have payload and Variant#value *is nil* (None, true) => Ok(None), diff --git a/ext/src/ruby_api/engine.rs b/ext/src/ruby_api/engine.rs index ec3b790c..1c023752 100644 --- a/ext/src/ruby_api/engine.rs +++ b/ext/src/ruby_api/engine.rs @@ -90,7 +90,7 @@ impl Engine { pub fn new(args: &[Value]) -> Result { let args = scan_args::scan_args::<(), (Option,), (), (), (), ()>(args)?; let (config,) = args.optional; - let config = config.and_then(|v| if v.is_nil() { None } else { Some(v) }); + let config = config.filter(|v| !v.is_nil()); let inner = match config { Some(config) => { let config = RHash::try_convert(config).and_then(hash_to_config)?; diff --git a/ext/src/ruby_api/instance.rs b/ext/src/ruby_api/instance.rs index 0a8acf90..313bfbcb 100644 --- a/ext/src/ruby_api/instance.rs +++ b/ext/src/ruby_api/instance.rs @@ -43,10 +43,7 @@ impl Instance { scan_args::scan_args::<(Obj, &Module), (Option,), (), (), (), ()>(args)?; let (wrapped_store, module) = args.required; let mut context = wrapped_store.context_mut(); - let imports = args - .optional - .0 - .and_then(|v| if v.is_nil() { None } else { Some(v) }); + let imports = args.optional.0.filter(|v| !v.is_nil()); let imports: Vec = match imports { Some(arr) => {