-
-
Notifications
You must be signed in to change notification settings - Fork 191
142 lines (142 loc) · 6.1 KB
/
Copy pathci-test.yml
File metadata and controls
142 lines (142 loc) · 6.1 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
name: Test & documentation
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
env:
MAVEN_OPTS: -DtrimStackTrace=false
DEV_JDK: '21'
jobs:
license:
name: License check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.DEV_JDK }}
- uses: ./.github/actions/maven-cache
- run: mvn -V -B --no-transfer-progress license:check
timeout-minutes: 10
dependencies:
name: Dependency checks
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
timeout-minutes: 95
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.DEV_JDK }}
- uses: ./.github/actions/maven-cache
- uses: ./.github/actions/maven-github-settings
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set week for OWASP cache key
run: echo "WEEK=$(date +%Y-%U)" >> $GITHUB_ENV
- name: Restore OWASP dependency-check cache
uses: actions/cache/restore@v5
with:
path: ~/.dependency-check-data
key: owasp-dc-${{ env.WEEK }}
restore-keys: owasp-dc-
- name: OWASP dependency check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: mvn -V -B --no-transfer-progress dependency-check:check
timeout-minutes: 90
- name: Save OWASP dependency-check cache
if: github.event_name == 'push'
uses: actions/cache/save@v5
with:
path: ~/.dependency-check-data
key: owasp-dc-${{ env.WEEK }}
test:
name: ${{ matrix.os }} ${{ matrix.test-type }} (Java ${{ matrix.java-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
test-type: [unit, integration]
java-version: ['21']
exclude:
- os: windows-latest
test-type: unit
- os: macOS-latest
test-type: unit
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- uses: ./.github/actions/maven-cache
with:
java-version: ${{ matrix.java-version }}
- uses: ./.github/actions/maven-github-settings
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Maven Daemon
id: install-mvnd
uses: ./.github/actions/install-mvnd
with:
version: '1.0.6'
file-version-suffix: ''
cache: 'true'
- name: Maven Build
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_OPTS: ${{ env.MAVEN_OPTS }} -D'aether.connector.basic.connectTimeout=10000' -D'aether.connector.basic.requestTimeout=30000'
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress -T 1C compile test-compile -Ponnx-model -D'dependency-check.skip' -D'license.skip'
- name: Maven Unit Tests
id: unit-tests
if: matrix.test-type == 'unit'
timeout-minutes: 45
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress test -D'dependency-check.skip' -D'license.skip' -D'mvnd.maxLostKeepAlive=6000'
- name: Dependency tree on unit test failure
if: always() && matrix.test-type == 'unit' && steps.unit-tests.outcome == 'failure'
run: |
${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress dependency:tree -pl extensions/indexes/lucene -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' | tee dependency-tree-lucene.txt
echo "--- Lucene-related dependencies ---"
grep -i lucene dependency-tree-lucene.txt || true
- name: Maven Integration Tests
if: matrix.test-type == 'integration'
timeout-minutes: 45
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress verify "-Ponnx-model,!mac-dmg-on-mac" -DskipUnitTests=true -D'dependency-check.skip' -D'license.skip' -D'mvnd.maxLostKeepAlive=6000'
- name: Javadoc (ubuntu unit only)
if: matrix.os == 'ubuntu-latest' && matrix.test-type == 'unit'
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution' --also-make
- name: Maven Code Coverage (Develop branch, ubuntu unit only)
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' && matrix.test-type == 'unit'
env:
CI_NAME: github
BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }}
CI_BUILD_NUMBER: ${{ github.run_id }}
CI_BUILD_URL: https://github.com/${{ github.repository }}/commit/${{ github.event.after }}/checks
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -V -B --no-transfer-progress jacoco:report coveralls:report
- name: Save Maven cache
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.test-type == 'unit'
uses: actions/cache/save@v5
with:
path: ~/.m2
key: maven-${{ github.ref_name }}-java${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}
enableCrossOsArchive: true
- name: Archive build logs
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ runner.os }}-${{ matrix.test-type }}-java${{ matrix.java-version }}-build-logs
retention-days: 5
path: |
**/hs_err_pid*.log
**/target/surefire-reports/*
**/target/failsafe-reports/*
dependency-tree-lucene.txt