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
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI
on:
push:
branches:
- main
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
rubygems: latest

- name: Run RuboCop
run: bundle exec rubocop --fail-level warning --display-only-fail-level-offenses --format github

test:
name: Test - ${{ matrix.gemfile }} - Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
ruby: ["3.0", 3.1, 3.2, 3.3, 3.4]
gemfile:
[
activesupport-7.1,
activesupport-7.2,
activesupport-8.0,
activesupport-8.1,
]
exclude:
# Rails 7.2 is >= 3.1
- ruby: "3.0"
gemfile: activesupport-7.2
# Rails 8.0 is >= 3.2
- ruby: "3.0"
gemfile: activesupport-8.0
- ruby: 3.1
gemfile: activesupport-8.0
# Rails 8.1 is >= 3.2
- ruby: "3.0"
gemfile: activesupport-8.1
- ruby: 3.1
gemfile: activesupport-8.1

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile

steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Update .ruby-version with matrix value
run: echo "${{ matrix.ruby }}" >| .ruby-version
# Dependencies
- name: Set up Ruby and bundle install
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
rubygems: latest

# Test
- name: Run Unit tests
run: bundle exec rspec

- name: Publish Test Results
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: Test Results
report_paths: tmp/rspec.xml
detailed_summary: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

# rspec failure tracking
.rspec_status
marsh_grass*.gem
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--format documentation
--format RspecJunitFormatter --out tmp/rspec.xml
--color
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.7
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

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

group :development, :test do
gem 'rubocop'
gem 'rspec_junit_formatter'
end
5 changes: 5 additions & 0 deletions gemfiles/activesupport-7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem 'activesupport', '~> 7.1.0'

eval_gemfile "../Gemfile"
5 changes: 5 additions & 0 deletions gemfiles/activesupport-7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem 'activesupport', '~> 7.2.0'

eval_gemfile "../Gemfile"
5 changes: 5 additions & 0 deletions gemfiles/activesupport-8.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem 'activesupport', '~> 8.0.0'

eval_gemfile "../Gemfile"
5 changes: 5 additions & 0 deletions gemfiles/activesupport-8.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem 'activesupport', '~> 8.1.0'

eval_gemfile "../Gemfile"
2 changes: 1 addition & 1 deletion spec/marsh_grass_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def make_time(first, second)

# Should run (24 * 60 * 60) = 86400x and have all hours, minutes, and seconds of the day
# This test is too slow to run by default, so it is commented out.
xit 'allows testing against an iteration of hours, minutes, and seconds', time_of_day: %i[hours minutes seconds] do
it 'allows testing against an iteration of hours, minutes, and seconds', time_of_day: %i[hours minutes seconds], skip: 'Too slow to run by default' do
hours_minutes_and_seconds_to_run << Time.now.strftime('%H:%M:%S')
end
end
Expand Down