From 820ce3688038db6614a5da5b46d7e8306afe154c Mon Sep 17 00:00:00 2001 From: Evan Lecklider Date: Wed, 20 Sep 2023 09:48:46 -0700 Subject: [PATCH] Run tests on more Ruby versions and platforms We still exclude truffleruby and jruby, but we should be testing on Windows now and against Ruby head. This is lifted from Ruby's base64 gem's GitHub workflow and depends on Ruby's own version code which should give us better coverage. - https://github.com/ruby/base64/blob/master/.github/workflows/test.yml - https://github.com/ruby/actions/blob/master/.github/workflows/ruby_versions.yml --- .github/workflows/main.yml | 23 +++++++++++++++++------ README.md | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c88e091..15c2882 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Berns +name: Test Suite concurrency: cancel-in-progress: true @@ -7,22 +7,33 @@ concurrency: on: [push, pull_request] jobs: + ruby-versions: + uses: ruby/actions/.github/workflows/ruby_versions.yml@master + with: + min_version: 2.7 + test: + needs: ruby-versions + name: Test (${{ matrix.ruby }} / ${{ matrix.os }}) strategy: - fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] - ruby-version: [3.2, 3.1, '3.0', 2.7] + ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} + os: [ubuntu-latest, macos-latest, windows-latest] + exclude: + - { ruby: jruby } + - { ruby: jruby-head } + - { ruby: truffleruby } + - { ruby: truffleruby-head } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Set up Ruby ${{ matrix.ruby-version }} + - name: Set up Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: bundler-cache: true - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ matrix.ruby }} - name: Run tests & lint run: bundle exec rake suite diff --git a/README.md b/README.md index 2edd6e7..fd8be44 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ Or install it yourself as: gem install berns ``` +*Note:* Berns is only tested on Ruby's MRI/CRuby interpreter version 2.7 and +greater. Berns version 3.x and below support Ruby 2.5. Contributions are welcome +to get JRuby or TruffleRuby working. + ## Usage Note that all return string values will be UTF-8 encoded.