forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (143 loc) · 4.92 KB
/
ci.yaml
File metadata and controls
189 lines (143 loc) · 4.92 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
189
---
name: ci
on:
pull_request:
push:
branches:
- master
jobs:
lint:
name: lint (${{ matrix.ruby.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
ruby: [{ name: 2.7, value: 2.7.2 }]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Configure bundler
run: |
echo "BUNDLE_GEMFILE=Gemfile" >> $GITHUB_ENV
echo "BUNDLE_PATH=$(pwd)/vendor/bundle" >> $GITHUB_ENV
- name: Enable coverage tracking
run: echo "COVERAGE=true" >> $GITHUB_ENV
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby.value }}
bundler-cache: true
- name: Install a specific rubygems version
run: gem update --system 3.2.17
- name: Generate docs
run: bin/rake docs:build
- name: Setup git
run: |
git config --global user.email activeadmin@ci.dummy
git config --global user.name ActiveAdmin
- name: Run lints
run: bin/rake lint
- name: Run bug report template
run: ACTIVE_ADMIN_PATH=. ruby tasks/bug_report_template.rb
- name: Format coverage
run: |
bin/prepare_coverage
mv coverage/.resultset.json coverage/raw.lint.json
- name: Save partial coverage as an artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/raw.lint.json
test:
name: test (${{ matrix.ruby.name }}, ${{ matrix.deps }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
ruby: [{ name: 2.7, value: 2.7.2 }, { name: 2.6, value: 2.6.6 }]
os: [ubuntu-20.04]
deps: [rails_52, rails_60, rails_61, rails_61_turbolinks, rails_61_webpacker]
include:
- ruby: { name: 2.5, value: 2.5.8 }
os: ubuntu-20.04
deps: rails_52
- ruby: { name: 2.5, value: 2.5.8 }
os: ubuntu-20.04
deps: rails_60
- ruby: { name: 2.5, value: 2.5.8 }
os: ubuntu-20.04
deps: rails_61
env:
COVERAGE: true
steps:
- uses: actions/checkout@v2
- name: Configure bundler (default)
run: |
echo "BUNDLE_GEMFILE=Gemfile" >> $GITHUB_ENV
echo "BUNDLE_PATH=$(pwd)/vendor/bundle" >> $GITHUB_ENV
if: matrix.deps == 'rails_61'
- name: Configure bundler (alternative)
run: |
echo "BUNDLE_GEMFILE=gemfiles/${{ matrix.deps }}/Gemfile" >> $GITHUB_ENV
echo "BUNDLE_PATH=$(pwd)/gemfiles/${{ matrix.deps }}/vendor/bundle" >> $GITHUB_ENV
if: matrix.deps != 'rails_61'
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby.value }}
bundler-cache: true
- name: Install a specific rubygems version
run: gem update --system 3.2.17
- name: Setup git
run: |
git config --global user.email activeadmin@ci.dummy
git config --global user.name ActiveAdmin
- name: Create test app
run: bin/rake setup
- name: Restore cached RSpec runtimes
uses: actions/cache@v2
with:
path: tmp/parallel_runtime_rspec.log
key: runtimes-rspec-${{ matrix.ruby.value }}-${{ matrix.deps }}-${{ hashFiles('tmp/parallel_runtime_rspec.log') }}
- name: Run RSpec tests
run: |
bin/parallel_rspec
RSPEC_FILESYSTEM_CHANGES=true bin/rspec
- name: Restore cached cucumber runtimes
uses: actions/cache@v2
with:
path: tmp/parallel_runtime_cucumber.log
key: runtimes-cucumber-${{ matrix.ruby.value }}-${{ matrix.deps }}-${{ hashFiles('tmp/parallel_runtime_cucumber.log') }}
- name: Run Cucumber features
run: |
bin/parallel_cucumber --fail-fast
bin/cucumber --profile filesystem-changes
bin/cucumber --profile class-reloading
- name: Format coverage
run: |
bin/prepare_coverage
mv coverage/.resultset.json coverage/raw.${{ matrix.ruby.value }}.${{ matrix.deps }}.json
- name: Save partial coverage as an artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/raw.${{ matrix.ruby.value }}.${{ matrix.deps }}.json
upload_coverage:
runs-on: ubuntu-20.04
needs:
- lint
- test
steps:
- uses: actions/checkout@v2
- name: Download partial coverages
uses: actions/download-artifact@v2
with:
name: coverage
path: coverage
- name: Format, sum & upload results to Code Climate
uses: paambaati/codeclimate-action@v2.7.4
env:
CC_TEST_REPORTER_ID: 8d5fcf7abea6d56c625104a9d1a81140a588a7f546f4fa9de9bc6ffc8feaaf70
with:
debug: true
coverageLocations: coverage/raw.*.json:simplecov