-
-
Notifications
You must be signed in to change notification settings - Fork 42
188 lines (177 loc) · 5.31 KB
/
ci.yml
File metadata and controls
188 lines (177 loc) · 5.31 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches: [ master ]
schedule:
- cron: '0 1 * * *'
jobs:
lostconf:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lostconf
run: npx lostconf
v2_5-non-rails-rubocop:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: '4.0.2'
- name: Bundle install
working-directory: v2.5-non-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle install --jobs 4 --retry 3
- name: Run rubocop
working-directory: v2.5-non-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle exec rubocop
v2_4-non-rails-specs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '4.0'
- '3.4'
- '3.3'
- '3.2'
include:
- ruby: '4.0'
coverage: 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: ${{matrix.ruby}}
bundler: 'latest'
- name: Install latest bundler
run: |
cd v2.4-non-rails
gem install bundler --no-document
bundle config set without 'tools benchmarks docs'
- name: Bundle install
run: |
cd v2.4-non-rails
# For Ruby 4.0, use local gem path to avoid permission issues with default gems
if [ "${{ matrix.ruby }}" = "4.0" ]; then
bundle config set path vendor/bundle
fi
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Run all tests
env:
GITHUB_COVERAGE: ${{matrix.coverage}}
run: |
cd v2.4-non-rails
bundle exec rspec
v2_5-rails-rubocop:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: '4.0.2'
- name: Bundle install
working-directory: v2.5-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle install --jobs 4 --retry 3
- name: Run rubocop
working-directory: v2.5-rails
env:
BUNDLE_GEMFILE: Gemfile.lint
run: bundle exec rubocop
v2_4-rails-specs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '4.0'
- '3.4'
- '3.3'
- '3.2'
include:
- ruby: '4.0'
coverage: 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install package dependencies
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
- name: Set up Ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: ${{matrix.ruby}}
bundler: 'latest'
- name: Install latest bundler
run: |
cd v2.4-rails
gem install bundler --no-document
bundle config set without 'tools benchmarks docs'
- name: Bundle install
run: |
cd v2.4-rails
# For Ruby 4.0, use local gem path to avoid permission issues with default gems
if [ "${{ matrix.ruby }}" = "4.0" ]; then
bundle config set path vendor/bundle
fi
bundle config set without development
bundle install --jobs 4 --retry 3
- name: Setup db
run: |
cd v2.4-rails
bundle exec rake db:create
bundle exec rake db:test:prepare
- name: Run all tests
env:
GITHUB_COVERAGE: ${{matrix.coverage}}
run: |
cd v2.4-rails
bundle exec rspec
ci-success:
name: CI Success
runs-on: ubuntu-latest
if: always()
needs:
- lostconf
- v2_5-non-rails-rubocop
- v2_5-rails-rubocop
- v2_4-non-rails-specs
- v2_4-rails-specs
steps:
- name: Check all jobs passed
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled') ||
contains(needs.*.result, 'skipped')
run: exit 1
- run: echo "All CI checks passed!"