-
Notifications
You must be signed in to change notification settings - Fork 748
Add GitHub Actions workflow for running the Koans on multiple Ruby versions #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,61 @@ | ||
| name: CI | ||
| on: [push] | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| - main | ||
| schedule: | ||
| - cron: '0 9 1 * *' | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Monthly seems OK for a scheduled run. Let me know if something else makes more sense. |
||
|
|
||
| jobs: | ||
| koans: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| ruby: | ||
| - '2.0' | ||
| - '2.1' | ||
| - '2.2' | ||
| - '2.3' | ||
| - '2.4' | ||
| - '2.5' | ||
| - '2.6' | ||
| - '2.7' | ||
| - '3.0' | ||
| - '3.1' | ||
| - '3.2' | ||
| - '3.3' | ||
| - '3.4' | ||
| - '4.0' | ||
| - ruby-head | ||
| os: [ubuntu-latest] | ||
| include: | ||
| - ruby: '1.9' | ||
| os: ubuntu-22.04 | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Install Ruby! | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
|
|
||
| - name: Run solved koans | ||
| run: rake run | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Install Ruby! | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.2.2" | ||
| ruby-version: '4.0' | ||
|
|
||
| - name: run tests | ||
| run: rake test | ||
| run: rake test | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ def test_mandatory_keyword_arguments_without_mandatory_argument | |
| exception = assert_raise(___(ArgumentError)) do | ||
| method_with_mandatory_keyword_arguments | ||
| end | ||
| assert_match(/#{__("missing keyword: :one")}/, exception.message) | ||
| assert_match(/#{__("missing keyword: :?one")}/, exception.message) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruby 2.1-2.6 don't have the |
||
| end | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ def in_ruby_version(*versions) | |
| end | ||
|
|
||
| def before_ruby_version(version) | ||
| Gem::Version.new(RUBY_VERSION) < Gem::Version.new(version) | ||
| Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new(version) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The version of Rubygems that ships with Ruby 1.9.3 tries to mutate the string passed into |
||
| end | ||
|
|
||
| in_ruby_version("1.8") do | ||
|
|
@@ -519,6 +519,7 @@ def walk | |
| sensei.observe(step.meditate) | ||
| end | ||
| sensei.instruct | ||
| !sensei.failed? | ||
| end | ||
|
|
||
| def each_step | ||
|
|
@@ -536,6 +537,8 @@ def each_step | |
| end | ||
|
|
||
| END { | ||
| exception = $! | ||
|
|
||
| Neo::Koan.command_line(ARGV) | ||
| Neo::ThePath.new.walk | ||
| exit exception.nil? && Neo::ThePath.new.walk | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| require 'about_nil' | ||
| require 'about_hashes' | ||
| require 'about_methods' | ||
| in_ruby_version("2", "3", "4") do | ||
| in_ruby_version("2.[1-7]", "3", "4") do | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruby 2.0 has keyword arguments, but not required keyword arguments (which is about half the tests in this file). |
||
| require 'about_keyword_arguments' | ||
| end | ||
| require 'about_constants' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case #49 happens