Skip to content

Commit b126ab2

Browse files
committed
chore: Rework CI pipeline
* Switch to codecov coverage tracking like all other projects * Pin rubocop-config to current v14 tag instead of digest * Set up the usual CI workflows similar to other projects * Add usual release workflow * Group gems for development and test like for other projects * Fix formatting and style issues
1 parent 4d3695b commit b126ab2

File tree

8 files changed

+126
-41
lines changed

8 files changed

+126
-41
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: maintenance-cache-clear
3+
on:
4+
schedule:
5+
- cron: "0 0 1 * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
cache-clear:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: easimon/wipe-cache@v2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: maintenance-workflow-cleanup
3+
on:
4+
schedule:
5+
- cron: "0 0 1 * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
delete-workflow-runs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: Mattraks/delete-workflow-runs@v2
13+
with:
14+
token: ${{ github.token }}
15+
repository: ${{ github.repository }}
16+
retain_days: 180
17+
keep_minimum_runs: 50

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# vim: ft=yaml
2+
3+
name: release
4+
5+
on:
6+
push:
7+
tags:
8+
- v*
9+
10+
jobs:
11+
rubygems:
12+
if: github.repository == 'jgraichen/rack-remote'
13+
runs-on: ubuntu-24.04
14+
15+
permissions:
16+
contents: write
17+
id-token: write
18+
19+
env:
20+
BUNDLE_JOBS: 4
21+
BUNDLE_RETRY: 10
22+
BUNDLE_WITHOUT: development test
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ruby
30+
bundler-cache: true
31+
32+
- uses: rubygems/release-gem@v1
33+
34+
- uses: taiki-e/create-gh-release-action@v1
35+
with:
36+
changelog: CHANGELOG.md
37+
draft: true
38+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
name: test
33

44
on:
5-
- push
6-
- pull_request
5+
push:
6+
pull_request:
7+
workflow_dispatch:
78

89
jobs:
910
rspec:
@@ -14,37 +15,43 @@ jobs:
1415
fail-fast: false
1516
matrix:
1617
ruby:
18+
- "3.4"
1719
- "3.3"
1820
- "3.2"
1921
- "3.1"
2022
- "3.0"
2123
- "2.7"
2224

25+
env:
26+
BUNDLE_JOBS: 4
27+
BUNDLE_RETRY: 3
28+
BUNDLE_WITHOUT: development
29+
2330
steps:
2431
- uses: actions/checkout@master
2532
- uses: ruby/setup-ruby@v1
2633
with:
2734
ruby-version: ${{ matrix.ruby }}
2835
bundler-cache: true
29-
env:
30-
BUNDLE_JOBS: 4
31-
BUNDLE_RETRY: 3
32-
33-
- run: bundle exec rspec --color
36+
- run: bundle exec rspec --color --format documentation
37+
- uses: codecov/codecov-action@v5
38+
with:
39+
fail_ci_if_error: true
40+
token: ${{ secrets.CODECOV_TOKEN }}
3441

3542
rubocop:
3643
name: rubocop
3744
runs-on: ubuntu-24.04
3845

46+
env:
47+
BUNDLE_JOBS: 4
48+
BUNDLE_RETRY: 3
49+
BUNDLE_WITHOUT: test
50+
3951
steps:
4052
- uses: actions/checkout@master
4153
- uses: ruby/setup-ruby@v1
4254
with:
43-
ruby-version: "3.4.3"
55+
ruby-version: "3.4"
4456
bundler-cache: true
45-
env:
46-
BUNDLE_JOBS: 4
47-
BUNDLE_RETRY: 3
48-
49-
- name: Run rubocop
50-
run: bundle exec rubocop --parallel --color
57+
- run: bundle exec rubocop --parallel --color

Gemfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ gemspec
77

88
# Development gems
99
#
10-
gem 'coveralls'
11-
gem 'rack-test'
1210
gem 'rake'
13-
gem 'rspec'
14-
gem 'webmock', '~> 3.0'
11+
gem 'rspec', '~> 3.0'
12+
13+
group :development do
14+
gem 'rubocop-config', github: 'jgraichen/rubocop-config', tag: 'v14', require: false
15+
end
1516

1617
group :test do
17-
gem 'rubocop-config', github: 'jgraichen/rubocop-config', ref: 'v12', require: false
18+
gem 'rspec-github', require: false
19+
gem 'rspec-rails'
20+
21+
gem 'simplecov'
22+
gem 'simplecov-cobertura'
23+
24+
gem 'rack-test'
25+
gem 'webmock', '~> 3.0'
1826
end

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ remote services for running integration tests on distributed applications.
66

77
## Installation
88

9-
Add this line to your application's Gemfile:
9+
Add this line to your application's `Gemfile`:
1010

11-
gem 'rack-remote'
11+
```ruby
12+
gem 'rack-remote'
13+
```
1214

1315
And then execute:
1416

15-
$ bundle
17+
```console
18+
bundle
19+
```
1620

1721
Or install it yourself as:
1822

19-
$ gem install rack-remote
23+
```console
24+
gem install rack-remote
25+
```
2026

2127
## Usage
2228

@@ -44,8 +50,8 @@ Rack::Remote.invoke 'http://serv.domain.tld/proxyed/path', :factory_bot, factory
4450

4551
1. Fork it
4652
2. Create your feature branch (`git checkout -b my-new-feature`)
47-
4. Add specs
48-
5. Add features
49-
6. Commit your changes (`git commit -am 'Add some feature'`)
50-
7. Push to the branch (`git push origin my-new-feature`)
51-
8. Create new Pull Request
53+
3. Add specs
54+
4. Add features
55+
5. Commit your changes (`git commit -am 'Add some feature'`)
56+
6. Push to the branch (`git push origin my-new-feature`)
57+
7. Create new Pull Request

Rakefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,3 @@ require 'rspec/core/rake_task'
55

66
RSpec::Core::RakeTask.new(:spec)
77
task default: :spec
8-
9-
begin
10-
require 'yard'
11-
require 'yard/rake/yardoc_task'
12-
13-
YARD::Rake::YardocTask.new do |t|
14-
t.files = %w[lib/**/*.rb]
15-
t.options = %w[--output-dir doc/]
16-
end
17-
rescue LoadError # rubocop:disable Lint/SuppressedException
18-
end

spec/spec_helper.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# frozen_string_literal: true
22

3-
require 'coveralls'
4-
Coveralls.wear! do
3+
require 'simplecov'
4+
require 'simplecov-cobertura'
5+
6+
SimpleCov.start do
57
add_filter 'spec'
68
end
79

10+
SimpleCov.formatters = [
11+
SimpleCov::Formatter::HTMLFormatter,
12+
SimpleCov::Formatter::CoberturaFormatter,
13+
]
14+
815
require 'rack/test'
916
require 'rack/remote'
1017
require 'webmock/rspec'

0 commit comments

Comments
 (0)