-
Notifications
You must be signed in to change notification settings - Fork 124
96 lines (96 loc) · 3.11 KB
/
ci.yaml
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
on:
push:
branches:
- main
pull_request:
merge_group:
name: ci
jobs:
changeFinder:
runs-on: ubuntu-latest
outputs:
nodePaths: ${{ steps.interrogate.outputs.nodePaths }}
goPaths: ${{ steps.interrogate.outputs.goPaths }}
bashPaths: ${{ steps.interrogate.outputs.bashPaths }}
requiredJobs: ${{ steps.interrogate.outputs.requiredJobs }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
- id: interrogate
run: node ./.github/workflows/interrogate.js
env:
GITHUB_BASE_REF: ${{github.base_ref}}
test:
runs-on: ubuntu-latest
needs: changeFinder
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.changeFinder.outputs.nodePaths)}}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
- run: echo ./packages/${{ matrix.package }}
- run: cd ./packages/${{ matrix.package }}
- run: npm ci
working-directory: ./packages/${{ matrix.package }}
- run: pwd
- run: npm test
working-directory: ./packages/${{ matrix.package }}
- run: npm run lint
working-directory: ./packages/${{ matrix.package }}
go-test:
runs-on: ubuntu-latest
needs: changeFinder
strategy:
fail-fast: false
matrix:
module: ${{fromJson(needs.changeFinder.outputs.goPaths)}}
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '^1.16'
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: goimports
run: |
test -z "$($(go env GOPATH)/bin/goimports -l .)"
working-directory: ./${{ matrix.module }}
- name: Instructions to fix goimports (if necessary)
run: echo Run goimports -w .
if: failure()
- run: go test ./...
working-directory: ./${{ matrix.module }}
bash-test:
runs-on: ubuntu-latest
needs: changeFinder
strategy:
fail-fast: false
matrix:
module: ${{fromJson(needs.changeFinder.outputs.bashPaths)}}
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: bashtest
run: |
./test.sh
working-directory: ./${{ matrix.module }}
finale:
runs-on: ubuntu-latest
needs: changeFinder
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: 18
- run: npm install
- run: node ./.github/workflows/finale.js '${{needs.changeFinder.outputs.requiredJobs}}' ${{secrets.GITHUB_TOKEN}}