Repository navigation
132 lines (130 loc) · 3.89 KB
/
Copy pathci.yml
File metadata and controls
132 lines (130 loc) · 3.89 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
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
name: CI
on: [push, pull_request]
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-2.7-${{ hashFiles('**/Gemfile.lock') }}
- name: Run benchmarks
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake partial_benchmark
bundle exec rake translatable_benchmark
bundle exec rake slotable_benchmark
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rails_version: ['5.2.6', '6.0.4.4', '6.1.4.4', '7.0.2.3', 'main']
ruby_version: ['2.5', '2.6', '2.7', '3.0', '3.1']
output_buffer: ['global_buffer', 'local_buffer']
exclude:
- rails_version: '5.2.6'
ruby_version: '3.0'
- rails_version: '5.2.6'
ruby_version: '3.1'
- rails_version: '6.0.4.4'
ruby_version: '3.0'
- rails_version: '6.0.4.4'
ruby_version: '3.1'
- rails_version: '7.0.2.3'
ruby_version: '2.5'
- rails_version: '7.0.2.3'
ruby_version: '2.6'
- rails_version: 'main'
ruby_version: '2.5'
- rails_version: 'main'
ruby_version: '2.6'
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-${{ matrix.rails_version }}-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/Gemfile.lock') }}
- name: Build and test with Rake
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake
env:
RAISE_ON_WARNING: 1
MEASURE_COVERAGE: true
RAILS_VERSION: ${{ matrix.rails_version }}
VIEW_COMPONENT_USE_GLOBAL_OUTPUT_BUFFER: ${{ matrix.output_buffer == 'global_buffer' && 'true' || 'false' }}
- name: Upload coverage results
uses: actions/upload-artifact@master
if: always()
with:
name: simplecov-resultset-rails${{matrix.rails_version}}-ruby${{matrix.ruby_version}}
path: coverage
pvc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
repository: 'primer/view_components'
path: 'primer_view_components'
- uses: actions/checkout@master
with:
path: 'view_component'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/setup-node@v2
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: |
node_modules
vendor/bundle
key: gems-build-pvc-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/yarn.lock') }}
- name: Build and test with Rake
run: |
cd primer_view_components
yarn
cd demo && yarn && cd ..
bundle config path vendor/bundle
bundle install
bundle exec rake docs:preview
bundle exec rake
env:
VIEW_COMPONENT_PATH: ../view_component
RAILS_VERSION: '~> 6.1.0'
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Download coverage results
uses: actions/download-artifact@v2
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-2.7-${{ hashFiles('**/Gemfile.lock') }}
- name: Collate simplecov
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake coverage:report
env:
RAILS_VERSION: '~> 7.0.0'