11name : AST Java Wrapper CI
22
3- on : [ pull_request ]
3+ on : [pull_request]
44
55jobs :
66 integration-tests :
2121 - name : Checkout LFS objects
2222 run : git lfs checkout
2323
24-
2524 - name : Cache local Maven repository
2625 uses : actions/cache@v4
2726 with :
@@ -39,13 +38,15 @@ jobs:
3938 - name : Check existence of cx-linux binary
4039 run : |
4140 if [ ! -f "src/main/resources/cx-linux" ]; then
42- echo "cx-linux binary does not exist"; exit 1;
41+ echo "cx-linux binary does not exist"; exit 1;
4342 fi
43+
4444 - name : Check existence of cx.exe binary
4545 run : |
4646 if [ ! -f "src/main/resources/cx.exe" ]; then
4747 echo "cx.exe binary does not exist"; exit 1;
4848 fi
49+
4950 - name : Check existence of cx-mac binary
5051 run : |
5152 if [ ! -f "src/main/resources/cx-mac" ]; then
@@ -55,13 +56,12 @@ jobs:
5556 - name : Run tests with Maven
5657 run : mvn -B test --file pom.xml
5758 env :
58- CX_CLIENT_ID : ${{ secrets.CX_CLIENT_ID}}
59- CX_CLIENT_SECRET : ${{ secrets.CX_CLIENT_SECRET}}
59+ CX_CLIENT_ID : ${{ secrets.CX_CLIENT_ID }}
60+ CX_CLIENT_SECRET : ${{ secrets.CX_CLIENT_SECRET }}
6061 CX_BASE_URI : ${{ secrets.CX_BASE_URI }}
6162 CX_TENANT : ${{ secrets.CX_TENANT }}
6263 CX_APIKEY : ${{ secrets.CX_APIKEY }}
6364
64-
6565 - name : Build with Maven
6666 run : mvn -B verify -DskipTests -Dgpg.skip --file pom.xml
6767
7070 uses : jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e # v1.2
7171 with :
7272 path : ' **/spotbugsXml.xml'
73+
74+ code-coverage :
75+ runs-on : ubuntu-latest
76+ steps :
77+ - name : Checkout
78+ uses : actions/checkout@v4
79+
80+ - name : Cache local Maven repository
81+ uses : actions/cache@v4
82+ with :
83+ path : ~/.m2/repository
84+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
85+ restore-keys : |
86+ ${{ runner.os }}-maven-
87+
88+ - name : Set up JDK 11
89+ 90+ with :
91+ distribution : ' temurin'
92+ java-version : ' 11'
93+
94+ - name : Generate and Display Code Coverage Report
95+ run : |
96+ mvn clean verify
97+ mvn jacoco:report
98+ echo "Code Coverage Summary:"
99+ grep -A 10 "Total" target/site/jacoco/jacoco.csv || echo "Coverage report not found."
100+
101+ - name : Upload JaCoCo Coverage Report
102+ uses : actions/upload-artifact@v4
103+ with :
104+ name : jacoco-report
105+ path : target/site/jacoco/*
0 commit comments