forked from iisaphd/enroll
-
Notifications
You must be signed in to change notification settings - Fork 3
225 lines (223 loc) · 8.62 KB
/
ruby.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: Full suite check
on:
push:
schedule:
- cron: "0 6 * * *"
env: # https://stackoverflow.com/questions/59867124/how-can-i-access-github-action-environment-variables-within-a-bash-script-run-by
TEST_BOOSTERS_RSPEC_TEST_FILE_PATTERN: "{spec,components/benefit_markets/spec,components/benefit_sponsors,components/notifier,components/sponsored_benefits,components/transport_gateway,components/transport_profiles}/**/*_spec.rb"
TB_RSPEC_FORMATTER: "progress"
jobs:
testing_matrix:
name: ${{matrix.command_configs.name}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [12.x]
mongodb-version: ["3.6"]
command_configs:
- name: rubocop
skip_js: "true"
test_command: |
git fetch --no-tags origin
bundle exec rubocop-git origin/master | grep "no offenses detected"
# - name: Brakeman In Main app
# skip_js: 'true'
# test_command: |
# brakeman -i config/brakeman.ignore
# - name: Brakeman In Components
# skip_js: 'true'
# test_command: |
# for test_dir in `ls -1 components`; do
# cd components/$test_dir
# brakeman -i config/brakeman.ignore
# cd ../..
# done
- name: rspec 1/12
test_command: rspec_booster --job 1/12
- name: rspec 2/12
test_command: rspec_booster --job 2/12
- name: rspec 3/12
test_command: rspec_booster --job 3/12
- name: rspec 4/12
test_command: rspec_booster --job 4/12
- name: rspec 5/12
test_command: rspec_booster --job 5/12
- name: rspec 6/12
test_command: rspec_booster --job 6/12
- name: rspec 7/12
test_command: rspec_booster --job 7/12
- name: rspec 8/12
test_command: rspec_booster --job 8/12
- name: rspec 9/12
test_command: rspec_booster --job 9/12
- name: rspec 10/12
test_command: rspec_booster --job 10/12
- name: rspec 11/12
test_command: rspec_booster --job 11/12
- name: rspec 12/12
test_command: rspec_booster --job 12/12
- name: cucumber 1/4
test_command: |
cp -f config/cucumber.yml config/cucumber.yml.bak
cp -f config/cucumber_split.yml config/cucumber.yml
cat config/cucumber.yml
export DISPLAY=:99
if cucumber_booster --job 1/4 features
then
echo "Cucumber passed the first time!"
exit 0
else
cat config/cucumber.yml
ls -ltr && ls -ltr tmp
echo "catting rerun.txt"
cat rerun.txt
echo "Give cucumber one more try"
if bundle exec cucumber @rerun.txt --profile first_rerun
then
echo "Cucumber worked on retry"
exit 0
else
echo "Give cucumber yet another try"
cat config/cucumber.yml
bundle exec cucumber @tmp/cucumber_failures_2.log --profile second_rerun
fi
fi
needs_chromedriver: true
- name: cucumber 2/4
test_command: |
cp -f config/cucumber.yml config/cucumber.yml.bak
cp -f config/cucumber_split.yml config/cucumber.yml
cat config/cucumber.yml
export DISPLAY=:99
if cucumber_booster --job 2/4 features
then
echo "Cucumber passed the first time!"
exit 0
else
cat config/cucumber.yml
ls -ltr && ls -ltr tmp
echo "catting rerun.txt"
cat rerun.txt
echo "Give cucumber one more try"
if bundle exec cucumber @rerun.txt --profile first_rerun
then
echo "Cucumber worked on retry"
exit 0
else
echo "Give cucumber yet another try"
cat config/cucumber.yml
bundle exec cucumber @tmp/cucumber_failures_2.log --profile second_rerun
fi
fi
needs_chromedriver: true
- name: cucumber 3/4
test_command: |
cp -f config/cucumber.yml config/cucumber.yml.bak
cp -f config/cucumber_split.yml config/cucumber.yml
cat config/cucumber.yml
export DISPLAY=:99
if cucumber_booster --job 3/4 features
then
echo "Cucumber passed the first time!"
exit 0
else
cat config/cucumber.yml
ls -ltr && ls -ltr tmp
echo "catting rerun.txt"
cat rerun.txt
echo "Give cucumber one more try"
if bundle exec cucumber @rerun.txt --profile first_rerun
then
echo "Cucumber worked on retry"
exit 0
else
echo "Give cucumber yet another try"
cat config/cucumber.yml
bundle exec cucumber @tmp/cucumber_failures_2.log --profile second_rerun
fi
fi
needs_chromedriver: true
- name: cucumber 4/4
test_command: |
cp -f config/cucumber.yml config/cucumber.yml.bak
cp -f config/cucumber_split.yml config/cucumber.yml
cat config/cucumber.yml
export DISPLAY=:99
if cucumber_booster --job 4/4 features
then
echo "Cucumber passed the first time!"
exit 0
else
cat config/cucumber.yml
cp -f config/cucumber.yml.bak config/cucumber.yml
cat config/cucumber.yml
ls -ltr && ls -ltr tmp
echo "catting rerun.txt"
cat rerun.txt
echo "Give cucumber one more try"
if bundle exec cucumber @rerun.txt --profile first_rerun
then
echo "Cucumber worked on retry"
exit 0
else
echo "Give cucumber yet another try"
bundle exec cucumber @tmp/cucumber_failures_2.log --profile second_rerun
fi
fi
needs_chromedriver: true
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
rubygems: 3.3.26
bundler-cache: true
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
if: matrix.command_configs.skip_js != 'true'
with:
# Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0, lts
node-version: ${{ matrix.node }}
- name: Launch MongoDB
uses: wbari/start-mongoDB@v0.2
if: matrix.command_configs.skip_js != 'true'
with:
mongoDBVersion: ${{ matrix.mongodb-version }}
- name: Set up Chromedriver
if: matrix.command_configs.needs_chromedriver
uses: nanasess/setup-chromedriver@master
- name: Cache Gems
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: Cache Node Modules
id: npm-cache
if: matrix.command_configs.skip_js != 'true'
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }}
- name: bundle install
run: |
gem install bundler -v '1.17.3'
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
gem install treye-semaphore_test_boosters --version '2.5.1'
gem install brakeman -v 5.4.1
- name: yarn install
if: matrix.command_configs.skip_js != 'true' && steps.npm-cache.outputs.cache-hit != 'true'
run: |
yarn install
- name: run webpack
if: matrix.command_configs.skip_js != 'true'
run: |
NODE_ENV=test RAILS_ENV=test ./bin/webpack
- name: run tests
run: ${{matrix.command_configs.test_command}}