Skip to content

Commit ccc2718

Browse files
Update gem tooling
** Why are these changes being introduced: * This repository does not yet have our pull request template, nor does it take advantage of our shared ruby workflows in Github actions. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/engx-175 ** How does this address that need: * This copies the pull request template and workflow yml file from another rails app, to bring this in line with our other projects. * Adds and integrates simplecov so the shared workflow does not error. ** Document any side effects to this change: * The theme gem now has test coverage
1 parent 7e52c15 commit ccc2718

7 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#### Developer
2+
3+
- [ ] All new ENV is documented in README
4+
- [ ] All new ENV has been added to Heroku Pipeline, Staging and Prod
5+
- [ ] ANDI or Wave has been run in accordance to
6+
[our guide](https://mitlibraries.github.io/guides/basics/a11y.html) and
7+
all issues introduced by these changes have been resolved or opened as new
8+
issues (link to those issues in the Pull Request details above)
9+
- [ ] Stakeholder approval has been confirmed (or is not needed)
10+
11+
#### Code Reviewer
12+
13+
- [ ] The commit message is clear and follows our guidelines
14+
(not just this pull request message)
15+
- [ ] There are appropriate tests covering any new functionality
16+
- [ ] The documentation has been updated or is unnecessary
17+
- [ ] The changes have been verified
18+
- [ ] New dependencies are appropriate or there were no changes
19+
20+
#### Requires database migrations?
21+
22+
YES | NO
23+
24+
#### Includes new or updated dependencies?
25+
26+
YES | NO
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
shared:
10+
uses: mitlibraries/.github/.github/workflows/ruby-shared-ci.yml@main

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.bundle/
2+
/coverage/
23
/doc/
34
/log/*.log
45
/pkg/

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.2

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ GEM
8080
irb (>= 1.3.6)
8181
reline (>= 0.3.1)
8282
digest (3.1.0)
83+
docile (1.4.0)
8384
erubi (1.11.0)
8485
ffi (1.15.5)
8586
globalid (1.0.0)
@@ -156,6 +157,13 @@ GEM
156157
sprockets (> 3.0)
157158
sprockets-rails
158159
tilt
160+
simplecov (0.21.2)
161+
docile (~> 1.1)
162+
simplecov-html (~> 0.11)
163+
simplecov_json_formatter (~> 0.1)
164+
simplecov-html (0.12.3)
165+
simplecov-lcov (0.8.0)
166+
simplecov_json_formatter (0.1.4)
159167
sprockets (4.1.1)
160168
concurrent-ruby (~> 1.0)
161169
rack (> 1, < 3)
@@ -181,6 +189,8 @@ PLATFORMS
181189
DEPENDENCIES
182190
debug (~> 1)
183191
mitlibraries-theme!
192+
simplecov (~> 0)
193+
simplecov-lcov (~> 0)
184194
sprockets-rails
185195
sqlite3
186196

mitlibraries-theme.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
2222
end
2323

2424
spec.add_development_dependency 'debug', '~> 1'
25+
spec.add_development_dependency 'simplecov', '~> 0'
26+
spec.add_development_dependency 'simplecov-lcov', '~> 0'
2527
spec.add_dependency 'rails', '>= 6', '< 8'
2628
spec.add_dependency 'sassc-rails', '~> 2'
2729
end

test/test_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Configure Rails Environment
22
ENV["RAILS_ENV"] = "test"
33

4+
require 'simplecov'
5+
require 'simplecov-lcov'
6+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
7+
SimpleCov::Formatter::LcovFormatter.config.lcov_file_name = 'coverage.lcov'
8+
SimpleCov.formatters = [
9+
SimpleCov::Formatter::HTMLFormatter,
10+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
11+
]
12+
SimpleCov.start('rails')
13+
414
require_relative "../test/dummy/config/environment"
515
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
616
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)

0 commit comments

Comments
 (0)