-
Notifications
You must be signed in to change notification settings - Fork 13
85 lines (74 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
85 lines (74 loc) · 2.39 KB
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
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.ruby }} / ${{ matrix.appraisal }}
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile
strategy:
fail-fast: false
matrix:
ruby:
- '3.1'
- '3.4'
- jruby-9.4
- jruby-10.0
appraisal:
- active_remote-6.1
- active_remote-7.0
- active_remote-7.1
- active_remote-7.2
- active_remote-8.0
exclude:
# active_remote 8.0 requires ruby 3.2 or later.
# jruby-9.4 is ruby 3.1 compatible.
- ruby: '3.1'
appraisal: active_remote-8.0
- ruby: jruby-9.4
appraisal: active_remote-8.0
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Generate the appraisal gemfiles
run: bundle exec appraisal generate
# bundler-cache above only caches the root Gemfile. The appraisal
# gemfiles do not exist until the step above runs, so they need their own
# cache. Without this every job installs active_remote from cold.
- name: Cache the appraisal dependencies
uses: actions/cache@v4
with:
path: gemfiles/vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.appraisal }}-${{ hashFiles('Appraisals', '*.gemspec') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.appraisal }}-
- name: Install the appraisal dependencies
run: |
bundle exec appraisal ${{ matrix.appraisal }} bundle config set --local path "$GITHUB_WORKSPACE/gemfiles/vendor/bundle"
bundle exec appraisal ${{ matrix.appraisal }} bundle install --jobs 4 --retry 3
- name: Run the specs
run: bundle exec appraisal ${{ matrix.appraisal }} rspec
rubocop:
name: RuboCop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Run RuboCop
run: bundle exec rubocop --parallel