-
Notifications
You must be signed in to change notification settings - Fork 149
113 lines (94 loc) · 3.22 KB
/
pull-requests.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
name: "Pull Request"
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
on:
pull_request:
branches:
- dev
- lts
- "*.*.*"
- "*.x"
paths-ignore:
- "docs/**"
jobs:
reviewdog-eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18.13.0
cache: yarn
- name: Install dependencies
run: yarn --immutable
- uses: reviewdog/action-eslint@9a6606695f1ef9709cce821919ca3b2a6d5e6bb5 # v1.32.0
with:
fail_on_error: true
eslint_flags: "."
node_options: "--max_old_space_size=4096"
code-scanning:
uses: ./.github/workflows/reusable-codeql-analysis.yml
package-tests:
uses: ./.github/workflows/reusable-package-tests.yml
typescript-changes:
runs-on: ubuntu-latest
outputs:
typescript: ${{ steps.filter.outputs.typescript }}
typescript_files: ${{ steps.filter.outputs.typescript_files }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
list-files: shell
filters: |
typescript:
- added|modified: 'packages/*/src/**/*.ts'
license-header-check:
needs: typescript-changes
if: ${{ needs.typescript-changes.outputs.typescript == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5
with:
go-version: "^1.17.0"
- name: Install addlicense
run: go install github.com/google/addlicense@latest
- name: Run addlicense
run: addlicense -f ./addlicense -check ${{ needs.typescript-changes.outputs.typescript_files }}
unit-tests:
uses: ./.github/workflows/reusable-unit-tests.yml
api-library-tests:
uses: ./.github/workflows/reusable-api-library-tests.yml
integration-tests-on-prem:
uses: ./.github/workflows/reusable-integration-tests-on-prem.yml
federation-tests:
uses: ./.github/workflows/reusable-federation-tests.yml
quality-gate:
if: ${{ always() }}
needs:
- reviewdog-eslint
- code-scanning
- package-tests
- unit-tests
- api-library-tests
- integration-tests-on-prem
- federation-tests
runs-on: ubuntu-latest
steps:
- name: Check Job Status
run: |
if [ ${{ needs.reviewdog-eslint.result }} != 'success' ] ||
[ ${{ needs.code-scanning.result }} != 'success' ] ||
[ ${{ needs.package-tests.result }} != 'success' ] ||
[ ${{ needs.unit-tests.result }} != 'success' ] ||
[ ${{ needs.api-library-tests.result }} != 'success' ] ||
[ ${{ needs.federation-tests.result }} != 'success' ] ||
[ ${{ needs.integration-tests-on-prem.result }} != 'success' ]; then
echo "One or more jobs failed"
exit 1
else
echo "Passed!"
fi