Skip to content

Commit

Permalink
Run tests on more Ruby versions and platforms
Browse files Browse the repository at this point in the history
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
  • Loading branch information
evanleck committed Sep 20, 2023
1 parent cb6f102 commit 820ce36
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Berns
name: Test Suite

concurrency:
cancel-in-progress: true
Expand All @@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 820ce36

Please sign in to comment.