-
Notifications
You must be signed in to change notification settings - Fork 18
97 lines (94 loc) · 2.98 KB
/
main.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
name: CI
on: [push,pull_request]
env:
BUNDLE_PATH: vendor/bundle
jobs:
lint:
name: Code Style
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
ruby:
- 2.6
- 2.7
- 3.0
- 3.1
- jruby
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Gemfile Cache
uses: actions/cache@v3
with:
path: Gemfile.lock
key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }}
restore-keys: |
${{ runner.os }}-gemlock-${{ matrix.ruby }}-
- name: Bundle Cache
id: cache-gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}-
${{ runner.os }}-gems-
- name: Bundle Install
if: steps.cache-gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: Rubocop Cache
uses: actions/cache@v3
with:
path: ~/.cache/rubocop_cache
key: ${{ runner.os }}-rubocop-${{ hashFiles('.rubocop.yml') }}
restore-keys: |
${{ runner.os }}-rubocop-
- name: Rubocop
run: bundle exec rubocop
test:
name: Specs
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
ruby:
- 2.6
- 2.7
- 3.0
- 3.1
- jruby
experimental: [false]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Gemfile Cache
uses: actions/cache@v3
with:
path: Gemfile.lock
key: ${{ runner.os }}-gemlock-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'format_parser.gemspec') }}
restore-keys: |
${{ runner.os }}-gemlock-${{ matrix.ruby }}-
- name: Bundle Cache
id: cache-gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('Gemfile', 'Gemfile.lock', 'format_parser.gemspec') }}
restore-keys: |
${{ runner.os }}-gems-${{ matrix.ruby }}-
${{ runner.os }}-gems-
- name: Bundle Install
if: steps.cache-gems.outputs.cache-hit != 'true'
run: bundle install --jobs 4 --retry 3
- name: RSpec
continue-on-error: ${{ matrix.experimental }}
run: bundle exec rake parallel:spec