Skip to content

Commit

Permalink
Test in container
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed May 9, 2024
1 parent 41b6ef7 commit 49c1807
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 24 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ on:
jobs:
test:
runs-on: ubuntu-latest
name: Test ${{ matrix.ruby }}
container:
image: ruby:${{ matrix.ruby_version }}
name: Test ${{ matrix.ruby_version }}
strategy:
matrix:
ruby:
- '3.3.1'
- '3.2.4'
- '3.1.5'
- '3.0.6'
- '2.7.8'

ruby_version:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Ruby version
run: ruby -v
- name: Gem version
run: gem -v
- name: Bundler version
run: bundle -v
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake spec
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@

# rspec failure tracking
.rspec_status
Gemfile.lock
/Gemfile.lock
/gemfiles/*.lock
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.gemfile": "ruby"
}
}
12 changes: 2 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in leash.gemspec
gemspec

gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"

gem "standard", "~> 1.3"
gemfile = "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION.split(".").take(2).join(".")}.gemfile"
eval_gemfile "gemfiles/#{gemfile}"
9 changes: 9 additions & 0 deletions gemfiles/ruby-2.7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0", require: false
gem "standard", "~> 1.0", require: false
9 changes: 9 additions & 0 deletions gemfiles/ruby-3.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0", require: false
gem "standard", "~> 1.0", require: false
9 changes: 9 additions & 0 deletions gemfiles/ruby-3.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0", require: false
gem "standard", "~> 1.0", require: false
9 changes: 9 additions & 0 deletions gemfiles/ruby-3.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0", require: false
gem "standard", "~> 1.0", require: false
9 changes: 9 additions & 0 deletions gemfiles/ruby-3.3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec path: ".."

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0", require: false
gem "standard", "~> 1.0", require: false

0 comments on commit 49c1807

Please sign in to comment.