-
-
Notifications
You must be signed in to change notification settings - Fork 276
121 lines (113 loc) · 3.35 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: CI
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
confirm_config_and_documentation:
runs-on: ubuntu-latest
name: Confirm config and documentation
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake confirm_config documentation_syntax_check confirm_documentation
main:
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- ruby-head
- jruby-9.4
task:
- internal_investigation
- spec
name: "Ruby ${{ matrix.ruby }}: ${{ matrix.task }}"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- run: NO_COVERAGE=true bundle exec rake ${{ matrix.task }}
coverage:
runs-on: ubuntu-latest
name: "Test coverage"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake spec
edge-rubocop:
runs-on: ubuntu-latest
strategy:
matrix:
task:
- internal_investigation
- spec
name: "Edge RuboCop: ${{ matrix.task }}"
steps:
- uses: actions/checkout@v4
- name: Use latest RuboCop from `master`
run: |
echo "gem 'rubocop', github: 'rubocop/rubocop'" > Gemfile.local
cat Gemfile.local
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rubocop -V
- run: NO_COVERAGE=true bundle exec rake ${{ matrix.task }}
oldest-rubocop:
runs-on: ubuntu-latest
strategy:
matrix:
task:
- spec
name: "Oldest RuboCop: ${{ matrix.task }}"
steps:
- uses: actions/checkout@v4
- name: Use oldest RuboCop allowed by gemspec
run: |
sed -nr "s/ *spec.add_dependency 'rubocop', '~> ([0-9\.]+)'/gem 'rubocop', '= \1'/p" \
rubocop-rspec.gemspec > Gemfile.local
cat Gemfile.local
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rubocop -V
- run: NO_COVERAGE=true bundle exec rake ${{ matrix.task }}
rspec4:
runs-on: ubuntu-latest
name: RSpec 4
steps:
- uses: actions/checkout@v4
- name: Use latest RSpec 4 from `4-0-dev` branch
run: |
sed -e '/rspec/d' -i Gemfile
cat << EOF > Gemfile.local
gem 'rspec', github: 'rspec/rspec-metagem', branch: '4-0-dev'
gem 'rspec-core', github: 'rspec/rspec-core', branch: '4-0-dev'
gem 'rspec-expectations', github: 'rspec/rspec-expectations', branch: '4-0-dev'
gem 'rspec-mocks', github: 'rspec/rspec-mocks', branch: '4-0-dev'
gem 'rspec-support', github: 'rspec/rspec-support', branch: '4-0-dev'
EOF
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: NO_COVERAGE=true bundle exec rake spec