-
Notifications
You must be signed in to change notification settings - Fork 94
114 lines (109 loc) · 3.2 KB
/
single-matrix-pr.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
# License: LGPL-3.0-or-later
name: Single Matrix Version Pull Request Build
on:
workflow_call:
inputs:
node:
type: string
ruby:
type: string
os:
type: string
env:
# this version used for running various tools
tool_node_version: "16.x"
tool_ruby_version: "3.0.6"
jobs:
changes:
name: "Check for file changes"
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
filters: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
# Path to file where filters are defined
filters: .github/path-filters.yml
package-download:
name: "Package caching"
uses: "./.github/workflows/cache-packages.yml"
needs: changes
with:
os: ${{ inputs.os }}
node: ${{ contains(needs.changes.outputs.filters, 'build-js') && inputs.node }}
ruby: ${{ contains(needs.changes.outputs.filters, 'setup-ruby') && inputs.ruby }}
markdownlint:
name: Lint markdown code
needs: changes
if: ${{ contains(needs.changes.outputs.filters, 'markdown')}}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Run markdownlint
run: yarn markdownlint
ruby_build:
name: "Ruby build and spec"
needs:
- package-download
- changes
runs-on: ${{ inputs.os }}
if: ${{ contains(needs.changes.outputs.filters, 'build-ruby') }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/after-checkout-prep
with:
node: ${{ inputs.node }}
ruby: ${{ inputs.ruby }}
- name: install bess dependencies
run: |
cd gems/bess
bundle install --jobs 3 --retry 3
- name: run spec for bess
run: |
cd gems/bess
bundle exec rake spec
- run: bin/setup ci
- name: Generate JS routes
run: bin/rails js:routes:typescript
- name: run spec
run: bundle exec rake spec
- name: run assets:precompile
run: WEBPACKER_PRECOMPILE=f bin/rails assets:precompile
webpack:
name: "Webpack JS files"
needs: package-download
if: ${{ contains(needs.changes.outputs.filters, 'build-js') }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/after-checkout-prep
with:
node: ${{ inputs.node }}
ruby: ${{ inputs.ruby }}
- name: run setup
run: bin/setup ci
- name: Generate JS routes
run: bin/rails js:routes:typescript
- name: Webpack compile everything
run: yarn webpack
- name: Verify storybook compiles
run: yarn build-storybook
jest:
name: "Jest for JS"
needs: package-download
if: ${{ contains(needs.changes.outputs.filters, 'build-js') }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/after-checkout-prep
with:
node: ${{ inputs.node }}
ruby: ${{ inputs.ruby }}
- run: bin/setup ci
- name: Generate JS routes
run: bin/rails js:routes:typescript
- name: run test:js
run: yarn test:js