-
Notifications
You must be signed in to change notification settings - Fork 440
133 lines (131 loc) · 4.13 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Run benchmarks
run: |
bundle exec rake partial_benchmark
bundle exec rake translatable_benchmark
test:
name: test (${{ matrix.rails_version }}, ${{ matrix.ruby_version }}, ${{ matrix.mode }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ruby_version: "3.1"
rails_version: "6.1"
mode: "capture_patch_enabled"
- ruby_version: "3.1"
rails_version: "6.1"
mode: "capture_patch_disabled"
- ruby_version: "3.1"
rails_version: "7.0"
mode: "capture_patch_enabled"
- ruby_version: "3.1"
rails_version: "7.0"
mode: "capture_patch_disabled"
- ruby_version: "3.2"
rails_version: "7.1"
mode: "capture_patch_enabled"
- ruby_version: "3.2"
rails_version: "7.1"
mode: "capture_patch_disabled"
- ruby_version: "3.3"
rails_version: "7.2"
mode: "capture_patch_disabled"
- ruby_version: "3.3"
rails_version: "7.2"
mode: "capture_patch_enabled"
- ruby_version: "head"
rails_version: "main"
mode: "capture_patch_disabled"
- ruby_version: "head"
rails_version: "main"
mode: "capture_patch_enabled"
env:
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile
steps:
- uses: actions/checkout@v4.1.1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Build and test with Rake
# Code-reloading isn't compatible with simplecov, so we need to run once
# to collect coverage, and again to test reloads.
run: |
bundle exec appraisal rails-${{ matrix.rails_version }} bundle
MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
ENABLE_RELOADING=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
env:
RAISE_ON_WARNING: 1
RAILS_VERSION: ${{ matrix.rails_version }}
RUBY_VERSION: ${{ matrix.ruby_version }}
CAPTURE_PATCH_ENABLED: ${{ matrix.mode == 'capture_patch_enabled' && 'true' || 'false' }}
- name: Upload coverage results
uses: actions/upload-artifact@v3.1.3
if: always()
with:
name: simplecov-resultset-rails${{matrix.rails_version}}-ruby${{matrix.ruby_version}}-${{matrix.mode}}
path: coverage
primer_view_components_compatibility:
name: Test compatibility with Primer ViewComponents (main)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
repository: 'primer/view_components'
path: 'primer_view_components'
- uses: actions/checkout@v4.1.1
with:
path: 'view_component'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
working-directory: 'view_component'
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
cache-dependency-path: 'primer_view_components/package-lock.json'
- name: Build and test with Rake
run: |
cd primer_view_components
npm ci
cd demo && npm ci && cd ..
bundle && bundle exec rake
env:
VIEW_COMPONENT_PATH: ../view_component
RAILS_VERSION: '7.1.1'
PARALLEL_WORKERS: '1'
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Download coverage results
uses: actions/download-artifact@v3
- name: Collate simplecov
run: |
bundle exec rake coverage:report