Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ on:

jobs:
test:

runs-on: ubuntu-latest
# Ruby 2.6/2.7 are still in the compatibility matrix and need the older Ubuntu image.
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
ruby-version: [2.6, 2.7, 3.0, 3.1]
ruby-version: ['2.6', '2.7', '3.0', '3.1']

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -29,3 +30,31 @@ jobs:

- name: Run tests
run: bundle exec rspec

quality:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Run RuboCop
run: bundle exec rubocop

- name: Build gem package
run: |
mkdir -p pkg
gem build irt_ruby.gemspec -o pkg/irt_ruby.gem

- name: Verify built gem installs
run: |
set -euo pipefail
gem install pkg/irt_ruby.gem --no-document
cd "$(mktemp -d)"
env -u BUNDLE_GEMFILE -u BUNDLE_PATH ruby -e "require 'irt_ruby'; result = IrtRuby::RaschModel.new([[1, 0], [0, 1]]).fit; raise 'missing abilities' unless result[:abilities].size == 2"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project are documented in this file.
- Added executable specs for README usage examples to keep the documented Rasch, 2PL, 3PL, and missing-data flows aligned with the public API.

### Changed
- Added CI RuboCop and gem package build/install verification, and documented the local quality and packaging commands for contributors.
- Clarified that response data must be a `Matrix` or array of arrays containing only integer `0`, integer `1`, or `nil`; floats, strings, booleans, and other values are rejected.

---
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ See `benchmarks/README.md` for detailed information about interpreting results.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` for the test suite or `bundle exec rake` for the default local quality gate: the RSpec suite and RuboCop. Before tagging a release, run `bundle exec rake build` to verify the gemspec packages cleanly from the current file list; CI also installs the built gem and smoke-tests `require 'irt_ruby'`. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).

Expand Down
Loading