0 | |
name: test
|
1 | |
|
2 | |
on:
|
3 | |
push:
|
4 | |
branches:
|
5 | |
- master
|
6 | |
pull_request:
|
7 | |
types:
|
8 | |
- opened
|
9 | |
- synchronize
|
10 | |
- reopened
|
11 | |
schedule:
|
12 | |
- cron: "0 0 * * 5" # JST 9:00 (Fri)
|
13 | |
|
14 | |
jobs:
|
15 | |
unit:
|
16 | |
runs-on: ubuntu-latest
|
17 | |
|
18 | |
strategy:
|
19 | |
fail-fast: false
|
20 | |
|
21 | |
matrix:
|
22 | |
ruby:
|
23 | |
- "2.3"
|
24 | |
- "2.4"
|
25 | |
- "2.5"
|
26 | |
- "2.6"
|
27 | |
- "2.7"
|
28 | |
- "3.0"
|
29 | |
- "3.1"
|
30 | |
rubyopt:
|
31 | |
- ""
|
32 | |
- "--jit"
|
33 | |
- "--yjit"
|
34 | |
exclude:
|
35 | |
# --jit is available since MRI 2.6
|
36 | |
- ruby: "2.3"
|
37 | |
rubyopt: "--jit"
|
38 | |
- ruby: "2.4"
|
39 | |
rubyopt: "--jit"
|
40 | |
- ruby: "2.5"
|
41 | |
rubyopt: "--jit"
|
42 | |
# --yjit is available since MRI 3.1
|
43 | |
- ruby: "2.3"
|
44 | |
rubyopt: "--yjit"
|
45 | |
- ruby: "2.4"
|
46 | |
rubyopt: "--yjit"
|
47 | |
- ruby: "2.5"
|
48 | |
rubyopt: "--yjit"
|
49 | |
- ruby: "2.6"
|
50 | |
rubyopt: "--yjit"
|
51 | |
- ruby: "2.7"
|
52 | |
rubyopt: "--yjit"
|
53 | |
- ruby: "3.0"
|
54 | |
rubyopt: "--yjit"
|
55 | |
env:
|
56 | |
RUBYOPT: ${{ matrix.rubyopt }}
|
57 | |
|
58 | |
steps:
|
59 | |
- uses: actions/checkout@v2
|
60 | |
|
61 | |
- uses: ruby/setup-ruby@v1
|
62 | |
with:
|
63 | |
ruby-version: ${{ matrix.ruby }}
|
64 | |
bundler-cache: true
|
65 | |
|
66 | |
- run: bundle update
|
67 | |
|
68 | |
- run: bundle exec rake spec:unit
|
69 | |
|
70 | |
- name: Slack Notification (not success)
|
71 | |
uses: lazy-actions/slatify@master
|
72 | |
if: "! success()"
|
73 | |
continue-on-error: true
|
74 | |
with:
|
75 | |
job_name: ${{ format('*unit* ({0},{1})', matrix.ruby, matrix.rubyopt) }}
|
76 | |
type: ${{ job.status }}
|
77 | |
icon_emoji: ":octocat:"
|
78 | |
url: ${{ secrets.SLACK_WEBHOOK }}
|
79 | |
token: ${{ secrets.GITHUB_TOKEN }}
|
80 | |
|
81 | |
integration-docker:
|
82 | |
runs-on: ubuntu-latest
|
83 | |
|
84 | |
strategy:
|
85 | |
fail-fast: false
|
86 | |
|
87 | |
matrix:
|
88 | |
ruby:
|
89 | |
- "2.3"
|
90 | |
- "2.4"
|
91 | |
- "2.5"
|
92 | |
- "2.6"
|
93 | |
- "2.7"
|
94 | |
- "3.0"
|
95 | |
- "3.1"
|
96 | |
rubyopt:
|
97 | |
- ""
|
98 | |
- "--jit"
|
99 | |
- "--yjit"
|
100 | |
image:
|
101 | |
- ubuntu:trusty
|
102 | |
exclude:
|
103 | |
# --jit is available since MRI 2.6
|
104 | |
- ruby: "2.3"
|
105 | |
rubyopt: "--jit"
|
106 | |
- ruby: "2.4"
|
107 | |
rubyopt: "--jit"
|
108 | |
- ruby: "2.5"
|
109 | |
rubyopt: "--jit"
|
110 | |
# --yjit is available since MRI 3.1
|
111 | |
- ruby: "2.3"
|
112 | |
rubyopt: "--yjit"
|
113 | |
- ruby: "2.4"
|
114 | |
rubyopt: "--yjit"
|
115 | |
- ruby: "2.5"
|
116 | |
rubyopt: "--yjit"
|
117 | |
- ruby: "2.6"
|
118 | |
rubyopt: "--yjit"
|
119 | |
- ruby: "2.7"
|
120 | |
rubyopt: "--yjit"
|
121 | |
- ruby: "3.0"
|
122 | |
rubyopt: "--yjit"
|
123 | |
|
124 | |
env:
|
125 | |
RUBYOPT: ${{ matrix.rubyopt }}
|
126 | |
TEST_IMAGE: ${{ matrix.image }}
|
127 | |
|
128 | |
steps:
|
129 | |
- uses: actions/checkout@v2
|
130 | |
|
131 | |
- uses: ruby/setup-ruby@v1
|
132 | |
with:
|
133 | |
ruby-version: ${{ matrix.ruby }}
|
134 | |
bundler-cache: true
|
135 | |
|
136 | |
- run: bundle update
|
137 | |
|
138 | |
- run: bundle exec rake spec:integration:docker:boot
|
139 | |
|
140 | |
- run: bundle exec rake spec:integration:docker:provision
|
141 | |
env:
|
142 | |
# FIXME: avoid error for "Command `chmod 777 /tmp/itamae_tmp` failed. (exit status: 1)"
|
143 | |
ITAMAE_TMP_DIR: /var/tmp/itamae_tmp
|
144 | |
|
145 | |
- run: bundle exec rake spec:integration:docker:serverspec
|
146 | |
- run: bundle exec rake spec:integration:docker:clean_docker_container
|
147 | |
|
148 | |
- name: Slack Notification (not success)
|
149 | |
uses: lazy-actions/slatify@master
|
150 | |
if: "! success()"
|
151 | |
continue-on-error: true
|
152 | |
with:
|
153 | |
job_name: ${{ format('*integration-docker* ({0},{1},{2})', matrix.ruby, matrix.rubyopt, matrix.image) }}
|
154 | |
type: ${{ job.status }}
|
155 | |
icon_emoji: ":octocat:"
|
156 | |
url: ${{ secrets.SLACK_WEBHOOK }}
|
157 | |
token: ${{ secrets.GITHUB_TOKEN }}
|
158 | |
|
159 | |
integration-local:
|
160 | |
runs-on: ubuntu-latest
|
161 | |
|
162 | |
strategy:
|
163 | |
fail-fast: false
|
164 | |
|
165 | |
matrix:
|
166 | |
ruby:
|
167 | |
- "2.3"
|
168 | |
- "2.4"
|
169 | |
- "2.5"
|
170 | |
- "2.6"
|
171 | |
- "2.7"
|
172 | |
- "3.0"
|
173 | |
- "3.1"
|
174 | |
rubyopt:
|
175 | |
- ""
|
176 | |
- "--jit"
|
177 | |
- "--yjit"
|
178 | |
exclude:
|
179 | |
# --jit is available since MRI 2.6
|
180 | |
- ruby: "2.3"
|
181 | |
rubyopt: "--jit"
|
182 | |
- ruby: "2.4"
|
183 | |
rubyopt: "--jit"
|
184 | |
- ruby: "2.5"
|
185 | |
rubyopt: "--jit"
|
186 | |
# --yjit is available since MRI 3.1
|
187 | |
- ruby: "2.3"
|
188 | |
rubyopt: "--yjit"
|
189 | |
- ruby: "2.4"
|
190 | |
rubyopt: "--yjit"
|
191 | |
- ruby: "2.5"
|
192 | |
rubyopt: "--yjit"
|
193 | |
- ruby: "2.6"
|
194 | |
rubyopt: "--yjit"
|
195 | |
- ruby: "2.7"
|
196 | |
rubyopt: "--yjit"
|
197 | |
- ruby: "3.0"
|
198 | |
rubyopt: "--yjit"
|
199 | |
|
200 | |
env:
|
201 | |
RUBYOPT: ${{ matrix.rubyopt }}
|
202 | |
|
203 | |
steps:
|
204 | |
- uses: actions/checkout@v2
|
205 | |
|
206 | |
- uses: ruby/setup-ruby@v1
|
207 | |
with:
|
208 | |
ruby-version: ${{ matrix.ruby }}
|
209 | |
bundler-cache: true
|
210 | |
|
211 | |
- run: bundle update
|
212 | |
|
213 | |
- run: bundle exec rake spec:integration:local:main
|
214 | |
- run: bundle exec rake spec:integration:local:ordinary_user
|
215 | |
|
216 | |
- name: Slack Notification (not success)
|
217 | |
uses: lazy-actions/slatify@master
|
218 | |
if: "! success()"
|
219 | |
continue-on-error: true
|
220 | |
with:
|
221 | |
job_name: ${{ format('*integration-local* ({0},{1})', matrix.ruby, matrix.rubyopt) }}
|
222 | |
type: ${{ job.status }}
|
223 | |
icon_emoji: ":octocat:"
|
224 | |
url: ${{ secrets.SLACK_WEBHOOK }}
|
225 | |
token: ${{ secrets.GITHUB_TOKEN }}
|
226 | |
|
227 | |
notify:
|
228 | |
needs:
|
229 | |
- unit
|
230 | |
- integration-docker
|
231 | |
- integration-local
|
232 | |
|
233 | |
runs-on: ubuntu-latest
|
234 | |
|
235 | |
steps:
|
236 | |
- name: Slack Notification (success)
|
237 | |
uses: lazy-actions/slatify@master
|
238 | |
if: always()
|
239 | |
continue-on-error: true
|
240 | |
with:
|
241 | |
job_name: '*notify*'
|
242 | |
type: ${{ job.status }}
|
243 | |
icon_emoji: ":octocat:"
|
244 | |
url: ${{ secrets.SLACK_WEBHOOK }}
|
245 | |
token: ${{ secrets.GITHUB_TOKEN }}
|