forked from primer/view_components
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (60 loc) · 1.64 KB
/
test-components.yml
File metadata and controls
65 lines (60 loc) · 1.64 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
name: test-components
on:
pull_request:
merge_group:
branches:
- main
types:
- checks_requested
permissions:
contents: read
concurrency:
group: test-components-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FERRUM_PROCESS_TIMEOUT: 30
jobs:
load-matrix:
name: Load test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: set-matrix
run: echo "matrix=$(cat .github/version-matrix.json | jq -c .)" >> $GITHUB_OUTPUT
components:
name: Components (${{ matrix.label }})
runs-on: ubuntu-latest
needs: load-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.load-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
cache-version: ${{ matrix.rails_version }}-${{ matrix.ruby_version }}
- uses: actions/setup-node@v5
with:
node-version: 20
cache: "npm"
- name: Build
run: |
npm ci
bundle config unset deployment
bundle install --jobs 4 --retry 3
env:
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
- name: Test
run: |
bundle exec rake test:components
bundle exec rake test:coverage
env:
COVERAGE: 1
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}