1
- name : Build and run tests
1
+ name : CI
2
2
3
3
on :
4
4
push :
12
12
workflow_dispatch :
13
13
14
14
permissions :
15
- contents : read
16
15
checks : write
17
16
pull-requests : write
18
17
19
18
jobs :
20
- build :
21
- # Skip duplicate build when pushing to already existing PR
22
- # Note: we decided NOT to skip duplicate builds,
23
- # since we upload test results via 'EnricoMi/publish-unit-test-result-action',
24
- # which requires 'pull_request' trigger for the bot to be able to add a comment to PR.
25
- # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
26
-
27
- name : Run tests on JDK ${{ matrix.jdk }}
28
-
29
- runs-on : ubuntu-latest
19
+ ci-core :
20
+ name : Run core tests on JDK ${{ matrix.jdk }}
21
+ runs-on : ubuntu-24.04
30
22
strategy :
31
23
fail-fast : false
32
24
matrix :
33
- jdk : [8, 11, 19]
34
- env :
35
- main_jdk : 8
25
+ jdk : [ 8, 11, 19 ]
36
26
37
27
steps :
38
- - uses : actions/checkout@v4
28
+ - name : Checkout repository
29
+ uses : actions/checkout@v4
39
30
40
31
- name : Set up Java
41
32
uses : actions/setup-java@v4
@@ -50,53 +41,12 @@ jobs:
50
41
# Builds on other branches will only read existing entries from the cache.
51
42
cache-read-only : ${{ github.ref != 'refs/heads/develop' && github.ref != 'ref/heads/neo' }}
52
43
53
- - name : Set up GraphViz
54
- uses : ts-graphviz/setup-graphviz@v2
55
-
56
- - name : Set up Node
57
- uses : actions/setup-node@v4
58
- with :
59
- node-version : ' 22'
60
-
61
- - name : Set up ArkAnalyzer
62
- run : |
63
- REPO_URL="https://gitcode.com/Lipen/arkanalyzer"
64
- DEST_DIR="arkanalyzer"
65
- MAX_RETRIES=10
66
- RETRY_DELAY=3 # Delay between retries in seconds
67
- BRANCH="neo/2025-05-30b"
68
-
69
- for ((i=1; i<=MAX_RETRIES; i++)); do
70
- git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break
71
- echo "Clone failed, retrying in $RETRY_DELAY seconds..."
72
- sleep "$RETRY_DELAY"
73
- done
74
-
75
- if [[ $i -gt $MAX_RETRIES ]]; then
76
- echo "Failed to clone the repository after $MAX_RETRIES attempts."
77
- exit 1
78
- else
79
- echo "Repository cloned successfully."
80
- fi
81
-
82
- echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV
83
- cd $DEST_DIR
84
-
85
- npm install
86
- npm run build
87
-
88
- - name : Generate test resources
89
- run : ./gradlew :jacodb-ets:generateTestResources --scan
90
-
91
- - name : Run ETS tests first
92
- run : ./gradlew :jacodb-ets:test --scan
93
-
94
44
- name : Build and run tests
95
- run : ./gradlew build --scan
45
+ run : ./gradlew --scan build -x :jacodb-ets:build
96
46
97
47
- name : Publish test results
98
48
uses : EnricoMi/publish-unit-test-result-action@v2
99
- if : always( )
49
+ if : (!cancelled() )
100
50
with :
101
51
files : " **/build/test-results/**/*.xml"
102
52
check_name : " Test results on JDK ${{ matrix.jdk }}"
@@ -106,23 +56,16 @@ jobs:
106
56
with :
107
57
token : ${{ secrets.CODECOV_TOKEN }}
108
58
109
- # - name: Upload test results
110
- # uses: actions/upload-artifact@v4
111
- # with:
112
- # name: test-results
113
- # path: build/test-results/
114
-
115
59
- name : Upload Gradle reports
116
- if : (!cancelled()) && matrix.jdk == env.main_jdk
60
+ if : (!cancelled())
117
61
uses : actions/upload-artifact@v4
118
62
with :
119
- name : gradle-reports
63
+ name : gradle-reports-jdk${{ matrix.jdk }}
120
64
path : ' **/build/reports/'
121
- retention-days : 1
122
65
123
- lifecycleTests :
66
+ ci-lifecycle :
124
67
name : Run lifecycle tests
125
- runs-on : ubuntu-latest
68
+ runs-on : ubuntu-24.04
126
69
steps :
127
70
- uses : actions/checkout@v4
128
71
140
83
cache-read-only : ${{ github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/neo' }}
141
84
142
85
- name : Build and run lifecycle tests
143
- run : ./gradlew lifecycleTest --scan
86
+ run : ./gradlew --scan lifecycleTest
144
87
145
88
- name : Upload coverage reports to Codecov
146
89
uses : codecov/codecov-action@v3
@@ -149,7 +92,64 @@ jobs:
149
92
150
93
- name : Publish test results
151
94
uses : EnricoMi/publish-unit-test-result-action@v2
152
- if : always( )
95
+ if : (!cancelled() )
153
96
with :
154
97
files : " **/build/test-results/**/*.xml"
155
98
check_name : " Lifecycle test results"
99
+
100
+ ci-ets :
101
+ name : Run ETS tests
102
+ runs-on : ubuntu-24.04
103
+ steps :
104
+ - name : Checkout repository
105
+ uses : actions/checkout@v4
106
+
107
+ - name : Set up Java
108
+ uses : actions/setup-java@v4
109
+ with :
110
+ java-version : 11
111
+ distribution : ' zulu'
112
+
113
+ - name : Set up Gradle
114
+ uses : gradle/actions/setup-gradle@v4
115
+ with :
116
+ # Only write to the cache for builds on the specific branches. (Default is 'main' only.)
117
+ # Builds on other branches will only read existing entries from the cache.
118
+ cache-read-only : ${{ github.ref != 'refs/heads/develop' && github.ref != 'ref/heads/neo' }}
119
+
120
+ - name : Set up ArkAnalyzer
121
+ run : |
122
+ REPO_URL="https://gitcode.com/Lipen/arkanalyzer"
123
+ DEST_DIR="arkanalyzer"
124
+ MAX_RETRIES=10
125
+ RETRY_DELAY=3 # Delay between retries in seconds
126
+ BRANCH="neo/2025-05-30b"
127
+
128
+ for ((i=1; i<=MAX_RETRIES; i++)); do
129
+ git clone --depth=1 --branch $BRANCH $REPO_URL $DEST_DIR && break
130
+ echo "Clone failed, retrying in $RETRY_DELAY seconds..."
131
+ sleep "$RETRY_DELAY"
132
+ done
133
+
134
+ if [[ $i -gt $MAX_RETRIES ]]; then
135
+ echo "Failed to clone the repository after $MAX_RETRIES attempts."
136
+ exit 1
137
+ else
138
+ echo "Repository cloned successfully."
139
+ fi
140
+
141
+ echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV
142
+ cd $DEST_DIR
143
+
144
+ npm install
145
+ npm run build
146
+
147
+ - name : Run ETS tests
148
+ run : ./gradlew --scan :jacodb-ets:generateTestResources :jacodb-ets:test
149
+
150
+ - name : Upload Gradle reports
151
+ if : (!cancelled())
152
+ uses : actions/upload-artifact@v4
153
+ with :
154
+ name : gradle-reports-ets
155
+ path : ' **/build/reports/'
0 commit comments