1- name : Build and run tests
1+ name : CI
22
33on :
44 push :
1212 workflow_dispatch :
1313
1414permissions :
15- contents : read
1615 checks : write
1716 pull-requests : write
1817
1918jobs :
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
3022 strategy :
3123 fail-fast : false
3224 matrix :
33- jdk : [8, 11, 19]
34- env :
35- main_jdk : 8
25+ jdk : [ 8, 11, 19 ]
3626
3727 steps :
38- - uses : actions/checkout@v4
28+ - name : Checkout repository
29+ uses : actions/checkout@v4
3930
4031 - name : Set up Java
4132 uses : actions/setup-java@v4
@@ -50,53 +41,12 @@ jobs:
5041 # Builds on other branches will only read existing entries from the cache.
5142 cache-read-only : ${{ github.ref != 'refs/heads/develop' && github.ref != 'ref/heads/neo' }}
5243
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-
9444 - name : Build and run tests
95- run : ./gradlew build --scan
45+ run : ./gradlew --scan build -x :jacodb-ets:build
9646
9747 - name : Publish test results
9848 uses : EnricoMi/publish-unit-test-result-action@v2
99- if : always( )
49+ if : (!cancelled() )
10050 with :
10151 files : " **/build/test-results/**/*.xml"
10252 check_name : " Test results on JDK ${{ matrix.jdk }}"
@@ -106,23 +56,16 @@ jobs:
10656 with :
10757 token : ${{ secrets.CODECOV_TOKEN }}
10858
109- # - name: Upload test results
110- # uses: actions/upload-artifact@v4
111- # with:
112- # name: test-results
113- # path: build/test-results/
114-
11559 - name : Upload Gradle reports
116- if : (!cancelled()) && matrix.jdk == env.main_jdk
60+ if : (!cancelled())
11761 uses : actions/upload-artifact@v4
11862 with :
119- name : gradle-reports
63+ name : gradle-reports-jdk${{ matrix.jdk }}
12064 path : ' **/build/reports/'
121- retention-days : 1
12265
123- lifecycleTests :
66+ ci-lifecycle :
12467 name : Run lifecycle tests
125- runs-on : ubuntu-latest
68+ runs-on : ubuntu-24.04
12669 steps :
12770 - uses : actions/checkout@v4
12871
14083 cache-read-only : ${{ github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/neo' }}
14184
14285 - name : Build and run lifecycle tests
143- run : ./gradlew lifecycleTest --scan
86+ run : ./gradlew --scan lifecycleTest
14487
14588 - name : Upload coverage reports to Codecov
14689 uses : codecov/codecov-action@v3
@@ -149,7 +92,64 @@ jobs:
14992
15093 - name : Publish test results
15194 uses : EnricoMi/publish-unit-test-result-action@v2
152- if : always( )
95+ if : (!cancelled() )
15396 with :
15497 files : " **/build/test-results/**/*.xml"
15598 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