-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (62 loc) · 1.81 KB
/
ci.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
---
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
name: 'test'
strategy:
fail-fast: false
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
steps:
- uses: actions/[email protected]
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- uses: actions/[email protected]
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('./Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: install gems
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: test
env:
HATENABLOG_CONSUMER_KEY: dummy
HATENABLOG_CONSUMER_SECRET: dummy
HATENABLOG_ACCESS_TOKEN_SECRET: dummy
HATENABLOG_ACCESS_TOKEN: dummy
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CI: true
run: |
bundle exec rspec
rubocop:
runs-on: ubuntu-latest
name: 'rubocop'
steps:
- uses: actions/[email protected]
- uses: ruby/[email protected]
with:
ruby-version: .ruby-version
- run: |
gem install rubocop
- name: reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s
rubocop | ./bin/reviewdog -f=rubocop -reporter=github-pr-review
slack-notify:
if: always()
needs: [test, rubocop]
name: post slack
runs-on: ubuntu-latest
steps:
- uses: Gamesight/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}