allow returning custom error types with automatic conversion to Error #937
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
# intel | |
- macos-12 | |
# arm | |
- macos-14 | |
- windows-latest | |
ruby-version: | |
- "2.7" | |
- "3.0" | |
- "3.1" | |
- "3.2" | |
- "3.3" | |
- head | |
rustup-toolchain: | |
- "1.61" | |
- stable | |
exclude: | |
- os: windows-latest | |
ruby-version: "3.3" | |
- os: windows-latest | |
ruby-version: head | |
# This works locally (macOS 14.3, M2, Ruby 3.1.4, Rust 1.75) | |
# and all other OS/arch/ruby/rust versions work, so not sure | |
# this specific setup on GH actions fails. | |
- os: macos-14 | |
ruby-version: "3.1" | |
rustup-toolchain: stable | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1 | |
with: | |
rustup-toolchain: ${{ matrix.rustup-toolchain }} | |
ruby-version: ${{ matrix.ruby-version }} | |
cache-version: v2 | |
bundler-cache: true | |
cargo-cache: true | |
cargo-cache-extra-path: | | |
examples/rust_blank/tmp/ | |
examples/complete_object/tmp/ | |
examples/custom_exception_ruby/tmp/ | |
examples/custom_exception_rust/tmp/ | |
# Ruby head is currently missing the power_assert default gem | |
- name: Ruby head bug workaround | |
if: matrix.ruby-version == 'head' | |
run: gem install power_assert | |
- name: Example gem tests (blank?) | |
working-directory: examples/rust_blank | |
run: bundle exec rake test | |
- name: Example gem tests (complete object) | |
working-directory: examples/complete_object | |
run: bundle exec rake test | |
- name: Example gem tests (custom exception defined in Ruby) | |
if: matrix.ruby-version != 'head' | |
working-directory: examples/custom_exception_ruby | |
run: bundle exec rake test | |
- name: Example gem tests (custom exception defined in Rust) | |
if: matrix.ruby-version != 'head' | |
working-directory: examples/custom_exception_rust | |
run: bundle exec rake test | |
- name: Run tests | |
run: cargo test --workspace |