98 lines (81 loc) · 2.5 KB
/
test.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
name: test
on:
push:
schedule:
- cron: "0 10 * * 5" # JST 19:00 (Fri)
env:
CI: "true"
jobs:
test:
runs-on: ubuntu-latest
container: ${{ matrix.ruby }}
strategy:
fail-fast: false
matrix:
ruby:
- ruby:2.5
- ruby:2.6
- ruby:2.7
- rubylang/ruby:master-nightly-bionic
include:
- ruby: rubylang/ruby:master-nightly-bionic
allow_failures: "true"
steps:
- uses: actions/checkout@v2
- name: Cache vendor/bundle
uses: actions/cache@v1
id: cache_gem
with:
path: vendor/bundle
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
restore-keys: |
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
continue-on-error: ${{ matrix.allow_failures == 'true' }}
- name: bundle update
run: |
set -xe
bundle config path vendor/bundle
bundle update --jobs $(nproc) --retry 3
continue-on-error: ${{ matrix.allow_failures == 'true' }}
- name: Setup Code Climate Test Reporter
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: before-build
if: matrix.ruby >= 'ruby:2.4'
continue-on-error: true
- name: Run test
run: |
set -xe
bundle exec rspec
continue-on-error: ${{ matrix.allow_failures == 'true' }}
- name: Teardown Code Climate Test Reporter
uses: aktions/codeclimate-test-reporter@v1
with:
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
command: after-build
if: matrix.ruby >= 'ruby:2.4' && always()
continue-on-error: true
- name: Slack Notification (not success)
uses: homoluctus/slatify@master
if: "! success()"
with:
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
notify:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Slack Notification (success)
uses: homoluctus/slatify@master
if: always()
with:
job_name: '*build*'
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}