Repository navigation
216 lines (193 loc) · 9.5 KB
/
Copy pathserver-ci.yml
File metadata and controls
216 lines (193 loc) · 9.5 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
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
213
214
215
216
name: "HugeGraph-Server CI"
on:
push:
branches: [master, 'release-*', 'test-*', 'tinkerpop-*']
pull_request:
schedule:
- cron: '0 6 * * 1'
timezone: Asia/Singapore
workflow_dispatch:
inputs:
test-set:
description: Tests to run on the selected branch
type: choice
default: mainline
options: [mainline, dependencies, distributed, macos-arm, hbase, riscv64, codeql, full]
# New PR heads and master pushes replace their old runs; scheduled and manual runs stay independent.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref == 'refs/heads/master' && github.ref) || github.run_id }}-${{ github.run_attempt == 1 && 'head' || format('rerun-{0}', github.run_id) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
permissions:
contents: read
pull-requests: read
jobs:
preflight:
name: check-license
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
PYTHONDONTWRITEBYTECODE: '1'
outputs:
dependency_baseline: ${{ steps.baseline.outputs.enabled }}
selection_result: ${{ steps.select.outcome }}
java_result: ${{ steps.java.outcome }}
java_versions: ${{ steps.java.outputs.versions }}
server: ${{ steps.select.outputs.server }}
commons: ${{ steps.select.outputs.commons }}
struct: ${{ steps.select.outputs.struct }}
pd: ${{ steps.select.outputs.pd }}
store: ${{ steps.select.outputs.store }}
hstore: ${{ steps.select.outputs.hstore }}
pd_store: ${{ steps.select.outputs.pd_store }}
cluster: ${{ steps.select.outputs.cluster }}
docker: ${{ steps.select.outputs.docker }}
helm: ${{ steps.select.outputs.helm }}
dependency_license: ${{ steps.select.outputs.dependency_license }}
macos: ${{ steps.select.outputs.macos }}
macos_full: ${{ steps.select.outputs.macos_full }}
hbase: ${{ steps.select.outputs.hbase }}
riscv64: ${{ steps.select.outputs.riscv64 }}
security: ${{ steps.select.outputs.security }}
distributed_smoke: ${{ steps.select.outputs.distributed_smoke }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Select affected tests
id: select
env:
GH_TOKEN: ${{ github.token }}
run: >-
python3 .github/scripts/ci-policy.py plan --project server
--event-name "$GITHUB_EVENT_NAME" --event-path "$GITHUB_EVENT_PATH"
--repository "$GITHUB_REPOSITORY" --output "$RUNNER_TEMP/ci-plan.json"
- name: Select trusted master baseline
id: baseline
env:
ENABLED: ${{ ((github.repository == 'apache/hugegraph' && github.event.repository.fork == false) || github.repository == 'hugegraph/hugegraph') && github.ref == 'refs/heads/master' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.test-set == 'dependencies')) }}
run: echo "enabled=$ENABLED" >> "$GITHUB_OUTPUT"
- name: Read project Java runtime
id: java
if: ${{ !cancelled() && steps.checkout.outcome == 'success' }}
run: |
python3 - <<'PYTHON'
import json
import os
import re
from pathlib import Path
runtime = Path('.github/workflows/.java-version').read_text().strip()
if not re.fullmatch(r'[1-9][0-9]*(\.[0-9]+)*', runtime):
raise ValueError('Project Java runtime must be a non-empty numeric version')
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
print('versions=' + json.dumps([runtime]), file=output)
PYTHON
- name: Record selection
if: ${{ !cancelled() && steps.select.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: ci-plan
path: ${{ runner.temp }}/ci-plan.json
retention-days: 7
overwrite: true
- name: Test CI policy and deployment checks
if: ${{ !cancelled() && steps.checkout.outcome == 'success' }}
run: python3 -m unittest discover -s .github/scripts -p 'test_*.py'
- name: Check Helm chart
if: ${{ !cancelled() && steps.checkout.outcome == 'success' && steps.select.outputs.helm == 'true' }}
uses: ./.github/actions/helm-checks
- name: Check license headers
if: ${{ !cancelled() && steps.checkout.outcome == 'success' }}
uses: apache/skywalking-eyes@main
with:
log: info
token: ${{ github.token }}
config: .licenserc.yaml
- name: License Check (RAT)
if: ${{ !cancelled() && steps.checkout.outcome == 'success' }}
run: |
mvn apache-rat:check -ntp
find . -name rat.txt -print0 | xargs -0 -I file cat file > "$RUNNER_TEMP/merged-rat.txt"
cat "$RUNNER_TEMP/merged-rat.txt"
build-server:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.server == 'true' }}
uses: ./.github/workflows/server-tests.yml
with:
backend: memory
java-versions: ${{ needs.preflight.outputs.java_versions }}
secrets: inherit
server-rocksdb:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.server == 'true' }}
uses: ./.github/workflows/server-tests.yml
with:
backend: rocksdb
java-versions: ${{ needs.preflight.outputs.java_versions }}
secrets: inherit
commons:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.commons == 'true' }}
uses: ./.github/workflows/commons-ci.yml
with:
java-versions: ${{ needs.preflight.outputs.java_versions }}
secrets: inherit
pd_store:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.pd_store == 'true' }}
uses: ./.github/workflows/pd-store-ci.yml
with:
run-struct: ${{ needs.preflight.outputs.struct == 'true' }}
run-pd: ${{ needs.preflight.outputs.pd == 'true' }}
run-store: ${{ needs.preflight.outputs.store == 'true' }}
run-hstore: ${{ needs.preflight.outputs.hstore == 'true' }}
secrets: inherit
cluster:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.cluster == 'true' }}
uses: ./.github/workflows/cluster-test-ci.yml
secrets: inherit
docker:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && (needs.preflight.outputs.docker == 'true' || needs.preflight.outputs.distributed_smoke == 'true') }}
uses: ./.github/workflows/docker-build-ci.yml
with:
smoke-only: ${{ needs.preflight.outputs.distributed_smoke == 'true' && needs.preflight.outputs.docker != 'true' }}
dependency_license:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && (needs.preflight.outputs.dependency_license == 'true' || (needs.preflight.outputs.dependency_baseline == 'true' && needs.preflight.result == 'success')) }}
uses: ./.github/workflows/check-dependencies.yml
with:
check-inventory: ${{ needs.preflight.outputs.dependency_license == 'true' }}
submit-baseline: ${{ needs.preflight.result == 'success' && needs.preflight.outputs.dependency_baseline == 'true' }}
dependency_baseline:
needs: [preflight, dependency_license]
if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.preflight.outputs.dependency_baseline == 'true' && needs.dependency_license.result == 'success' }}
uses: ./.github/workflows/submit-dependencies.yml
permissions:
contents: write
actions: read
with:
artifact-id: ${{ needs.dependency_license.outputs.artifact_id }}
inventory-artifact-id: ${{ needs.dependency_license.outputs.inventory_artifact_id }}
compatibility:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && (needs.preflight.outputs.macos == 'true' || needs.preflight.outputs.hbase == 'true' || needs.preflight.outputs.riscv64 == 'true') }}
uses: ./.github/workflows/server-compatibility-ci.yml
with:
java-versions: ${{ needs.preflight.outputs.java_versions }}
macos: ${{ needs.preflight.outputs.macos == 'true' }}
macos-full: ${{ needs.preflight.outputs.macos_full == 'true' }}
hbase: ${{ needs.preflight.outputs.hbase == 'true' }}
riscv64: ${{ needs.preflight.outputs.riscv64 == 'true' }}
secrets: inherit
codeql:
needs: preflight
if: ${{ !cancelled() && needs.preflight.outputs.selection_result == 'success' && needs.preflight.outputs.java_result == 'success' && needs.preflight.outputs.security == 'true' }}
uses: ./.github/workflows/codeql-analysis.yml
permissions:
contents: read
actions: read
security-events: write