-
Notifications
You must be signed in to change notification settings - Fork 122
200 lines (178 loc) · 6.61 KB
/
Copy pathhubble-ci.yml
File metadata and controls
200 lines (178 loc) · 6.61 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
name: "hubble-ci"
on:
workflow_dispatch:
push:
branches:
- master
- 'release-*'
paths:
- hugegraph-hubble/**
- hugegraph-dist/**
- hugegraph-loader/**
- .github/workflows/**
- pom.xml
pull_request:
paths:
- hugegraph-hubble/**
- hugegraph-dist/**
- hugegraph-loader/**
- hugegraph-client/**
- .github/workflows/**
- pom.xml
env:
TRAVIS_DIR: hugegraph-hubble/hubble-dist/assembly/travis
HUGEGRAPH_SERVER_COMMIT: 99936be5f41fccd193f120e01206e3cf3c73a050
HUGEGRAPH_SERVER_FETCH_REF: refs/heads/master
jobs:
hubble-ci:
runs-on: ubuntu-latest
env:
USE_STAGE: 'true' # Whether to include the stage repository.
STATIC_DIR: hugegraph-hubble/hubble-dist/assembly/static
strategy:
matrix:
JAVA_VERSION: ['11']
python-version: ["3.11"]
steps:
- name: Fetch Code
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Setup Java environment
uses: ./.github/actions/setup-java-env
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'temurin'
use-stage: ${{ env.USE_STAGE }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Set up Node.js 18.20.8
uses: actions/setup-node@v6
with:
node-version: '18.20.8'
# we also should cache python & yarn & downloads to avoid useless work
- name: Cache Maven packages
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache Node modules
uses: actions/cache@v6
with:
path: |
hugegraph-hubble/hubble-fe/node_modules
hugegraph-hubble/hubble-fe/node
~/.cache/yarn
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache Playwright browsers
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('hugegraph-hubble/hubble-fe/yarn.lock') }}
- name: Cache HugeGraph Server
uses: actions/cache@v6
with:
path: ~/hugegraph-cache-${{ env.HUGEGRAPH_SERVER_COMMIT }}
key: ${{ runner.os }}-hugegraph-server-${{ env.HUGEGRAPH_SERVER_COMMIT }}
- name: Frontend i18n check
working-directory: hugegraph-hubble/hubble-fe
env:
NODE_OPTIONS: --max-old-space-size=4096
run: |
yarn install --frozen-lockfile --network-timeout 600000 --prefer-offline --ignore-engines
yarn lint
yarn i18n:check
node --test ../hubble-dist/assembly/travis/ui_auth.test.js
- name: Install Playwright Chromium
working-directory: hugegraph-hubble/hubble-fe
run: yarn playwright install --with-deps chromium
- name: Compile
run: |
mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp
cd hugegraph-hubble && ls *
mvn -e compile -Dmaven.javadoc.skip=true -ntp
- name: Prepare env and service
env:
COMMIT_ID: ${{ env.HUGEGRAPH_SERVER_COMMIT }}
COMMIT_REF: ${{ env.HUGEGRAPH_SERVER_FETCH_REF }}
NODE_OPTIONS: --max-old-space-size=4096
run: |
echo "=== Environment Info ==="
node -v
yarn -v
echo "NODE_OPTIONS: $NODE_OPTIONS"
echo "COMMIT_ID: $COMMIT_ID"
echo "COMMIT_REF: $COMMIT_REF"
free -h || true
echo "======================="
python -m pip install -r ${TRAVIS_DIR}/requirements.txt
cd hugegraph-hubble
mvn package -Dmaven.test.skip=true
cd apache-hugegraph-hubble-*
cd bin
./start-hubble.sh -d
./stop-hubble.sh
cd ../../../
pwd
$TRAVIS_DIR/install-hugegraph.sh $COMMIT_ID $COMMIT_REF
- name: Release package audit
env:
GNUPGHOME: ${{ runner.temp }}/hubble-release-gate-gpghome
run: |
HUBBLE_TARBALL="$(ls hugegraph-hubble/target/apache-hugegraph-hubble-*.tar.gz | head -n 1)"
if [[ -z "${HUBBLE_TARBALL}" ]]; then
echo "Hubble tarball not found" >&2
exit 1
fi
mkdir -p "${GNUPGHOME}"
chmod 700 "${GNUPGHOME}"
shasum -a 512 "${HUBBLE_TARBALL}" > "${HUBBLE_TARBALL}.sha512"
printf '%s\n' \
'%no-protection' \
'Key-Type: RSA' \
'Key-Length: 2048' \
'Subkey-Type: RSA' \
'Subkey-Length: 2048' \
'Name-Real: Hubble CI Release Gate' \
'Name-Email: hubble-ci-release-gate@example.invalid' \
'Expire-Date: 0' \
'%commit' \
> "${RUNNER_TEMP}/hubble-release-gate-key.conf"
gpg --batch --generate-key "${RUNNER_TEMP}/hubble-release-gate-key.conf"
gpg --batch --yes --armor --detach-sign "${HUBBLE_TARBALL}"
bash "${TRAVIS_DIR}/check-hubble-dist.sh" "${HUBBLE_TARBALL}" \
--require-sidecars \
--json-output hugegraph-hubble/target/hubble-dist-check.json
- name: Unit test
run: mvn test -P unit-test -pl hugegraph-hubble/hubble-be -ntp
- name: API test
run: |
cd hugegraph-hubble
HUBBLE_TARBALL="$(ls target/apache-hugegraph-hubble-*.tar.gz | head -n 1)"
HUBBLE_694_EVIDENCE_DIR=target/hubble-live-acceptance \
hubble-dist/assembly/travis/verify-hubble-issue-694.sh \
"${HUBBLE_TARBALL}" http://127.0.0.1:8080
- name: Upload Hubble smoke evidence
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: hubble-smoke-java-${{ matrix.JAVA_VERSION }}-${{ github.run_attempt }}
path: |
hugegraph-hubble/target/hubble-dist-check.json
hugegraph-hubble/target/hubble-live-acceptance/**/*.json
hugegraph-hubble/target/hubble-live-acceptance/**/*.png
hugegraph-hubble/target/hubble-live-acceptance/**/*.log
if-no-files-found: warn
retention-days: 14
- name: Upload coverage to Codecov
uses: ./.github/actions/upload-coverage
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: target/site/jacoco/*.xml