-
Notifications
You must be signed in to change notification settings - Fork 17
212 lines (204 loc) · 6.57 KB
/
on.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: PR
"on":
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
concurrency:
group: "pr-${{ github.event.pull_request.number }}"
cancel-in-progress: true
jobs:
##
## Job: Change Triage
##
triage:
name: "Triage"
runs-on: ${{ vars.RUNNER_DEFAULT || 'ubuntu-latest' }}
permissions:
contents: "read"
outputs:
changes: ${{ steps.extract_branch.outputs.changes }}
branch: ${{ steps.extract_branch.outputs.branch }}
base: ${{ steps.filter.outputs.base }}
devcontainer: ${{ steps.filter.outputs.base }}
model: ${{ steps.filter.outputs.model }}
packages: ${{ steps.filter.outputs.packages }}
tools: ${{ steps.filter.outputs.tools }}
images: ${{ steps.filter.outputs.tools }}
srcs: ${{ steps.filter.outputs.srcs }}
steps:
- name: "Setup: Harden Runner"
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
persist-credentials: false
- name: "Triage: Branch Label"
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: "Triage: PR Labels"
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Triage: PR Changes"
id: filter
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
with:
filters: |
base: &base
- ".version"
- ".release"
- ".github/workflows/*.*"
devcontainer: &ci
- *base
- ".devcontainer/*.*"
- ".devcontainer/**/*.*"
model: &model
- *base
- "proto/**/*.*"
packages: &packages
- *base
- "packages"
- "packages/*"
- "packages/**/*.*"
tools: &tools
- *base
- "tools"
- "tools/*"
- "tools/**/*.*"
images: &images
- *base
- "tools/images/*"
- "tools/images/*.*"
- "tools/images/**/*.*"
srcs: &srcs
- *base
- *model
- *packages
- *tools
##
## Job: Pre-flight Checks
##
preflight-checks:
name: "Pre-flight Checks"
runs-on: ${{ vars.RUNNER_DEFAULT || 'ubuntu-latest' }}
needs: [triage]
if: fromJson(needs.triage.outputs.srcs)
permissions:
contents: "read"
id-token: "write"
checks: "write"
packages: "read"
pull-requests: "write"
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
persist-credentials: false
- name: "Setup: Buildless"
uses: buildless/setup@v1.0.2
- name: "Setup: GraalVM (Java 21)"
uses: graalvm/setup-graalvm@a1b47fdf04e772fed6b3b46131e226f9aea5e169 # v1
with:
distribution: "graalvm"
java-version: "21"
github-token: ${{ secrets.GITHUB_TOKEN }}
- id: "auth"
name: "Setup: Authorize Service Account"
uses: google-github-actions/auth@a6e2e39c0a0331da29f7fd2c2a20a427e8d3ad1f # v2.1.1
if: false # temporarily disabled
with:
credentials_json: "${{ secrets.BUILDBOT_SERVICE_ACCOUNT }}"
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
- name: "Patch: Neutralize Yarn Lock"
run: mv yarn.lock yarn.inert
- name: "Check: Dependency Review"
uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 # v4.0.0
continue-on-error: true
if: github.event_name == 'pull_request'
with:
config-file: "./.github/dependency-review-config.yml"
license-check: true
vulnerability-check: true
fail-on-severity: "low"
base-ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'v3' }}
- name: "Patch: Restore Yarn Lock"
run: mv yarn.inert yarn.lock
- name: "Check: Library ABI"
uses: gradle/gradle-build-action@3b1b3b9a2104c2b47fbae53f3938079c00c9bb87 # v3.0.0
id: abicheck
if: fromJson(needs.triage.outputs.packages)
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'ci:api-check-bypass') }}
env:
CI: true
GITHUB_ACTOR: ${{ env.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
with:
cache-read-only: false
arguments: |
apiCheck
--dependency-verification=lenient
--no-daemon
--stacktrace
--warning-mode=none
-Pelide.ci=true
-PbuildDocs=false
-PbuildSamples=false
-PbuildDocsSite=false
##
## Job: Multi-platform Build
##
pr-build:
name: "Build"
uses: ./.github/workflows/job.build.yml
secrets: inherit
needs: [triage, preflight-checks]
if: fromJson(needs.triage.outputs.model) || fromJson(needs.triage.outputs.packages) || fromJson(needs.triage.outputs.tools)
permissions:
actions: "read"
contents: "write"
id-token: "write"
checks: "write"
packages: "write"
pull-requests: "write"
deployments: "write"
statuses: "write"
security-events: "write"
with:
tests: true
provenance: false
##
## Job: Checks for Models
##
check-model:
name: "Checks"
uses: ./.github/workflows/checks.model.yml
secrets: inherit
needs: [triage, preflight-checks]
if: fromJson(needs.triage.outputs.model)
permissions:
contents: read
##
## Job: Checks with CodeQL
##
check-codeql:
name: "Checks"
uses: ./.github/workflows/checks.codeql.yml
secrets: inherit
needs: [triage, preflight-checks, pr-build]
if: fromJson(needs.triage.outputs.model) || fromJson(needs.triage.outputs.packages)
permissions:
actions: "read"
contents: "read"
security-events: "write"