-
Notifications
You must be signed in to change notification settings - Fork 566
110 lines (94 loc) · 2.82 KB
/
ci.yaml
File metadata and controls
110 lines (94 loc) · 2.82 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
name: CI
on:
push:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:
permissions:
contents: read
pull-requests: write # Allow posting PR comments for coverage reports
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai
jobs:
test:
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 16
matrix:
java: [ 8, 11, 17, 21, 25 ]
os: [ ubuntu-24.04, windows-latest, macos-latest ]
exclude:
# Exclude JDK 25 on macOS (not yet supported)
- java: 25
os: macos-latest
name: Test JDK ${{ matrix.java }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Build with Maven
run: ./mvnw -V --no-transfer-progress -Pgen-javadoc -Pgen-dokka clean package
test-reflect:
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 16
matrix:
java: [ 8, 11, 17, 21, 25 ]
os: [ ubuntu-24.04, windows-latest, macos-latest ]
exclude:
- java: 25
os: macos-latest
name: Test Reflect JDK ${{ matrix.java }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Build with Maven
run: ./mvnw -V --no-transfer-progress -Dfastjson2.creator=reflect clean package
shell: bash
coverage:
timeout-minutes: 20
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for better coverage analysis
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
cache: maven
- name: Build with Maven and generate coverage
run: ./mvnw -V --no-transfer-progress clean package
env:
CI: true # Explicitly set CI to ensure JaCoCo profile is activated
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: false
verbose: true