3535 distribution : ' temurin'
3636 java-version : ' 11'
3737
38+ - name : Set Executable Permissions for Binary Files
39+ run : |
40+ chmod +x src/main/resources/cx-linux
41+ chmod +x src/main/resources/cx.exe
42+ chmod +x src/main/resources/cx-mac
43+
3844 - name : Check existence of cx-linux binary
3945 run : |
4046 if [ ! -f "src/main/resources/cx-linux" ]; then
@@ -53,48 +59,19 @@ jobs:
5359 echo "cx-mac binary does not exist"; exit 1;
5460 fi
5561
56- - name : Run tests with Maven
57- run : mvn -B test --file pom.xml
62+ - name : Run tests with Maven and Generate Coverage Report
63+ run : |
64+ mvn clean verify
65+ mvn jacoco:report
5866 env :
5967 CX_CLIENT_ID : ${{ secrets.CX_CLIENT_ID }}
6068 CX_CLIENT_SECRET : ${{ secrets.CX_CLIENT_SECRET }}
6169 CX_BASE_URI : ${{ secrets.CX_BASE_URI }}
6270 CX_TENANT : ${{ secrets.CX_TENANT }}
6371 CX_APIKEY : ${{ secrets.CX_APIKEY }}
6472
65- - name : Build with Maven
66- run : mvn -B verify -DskipTests -Dgpg.skip --file pom.xml
67-
68- - name : Run SpotBugs Analysis
69- if : ${{ github.actor != 'dependabot[bot]' }}
70- uses : jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e # v1.2
71- with :
72- 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
73+ - name : Display Coverage Summary
9574 run : |
96- mvn clean verify
97- mvn jacoco:report
9875 echo "Code Coverage Summary:"
9976 grep -A 10 "Total" target/site/jacoco/jacoco.csv || echo "Coverage report not found."
10077
@@ -103,3 +80,12 @@ jobs:
10380 with :
10481 name : jacoco-report
10582 path : target/site/jacoco/*
83+
84+ - name : Build with Maven
85+ run : mvn -B verify -DskipTests -Dgpg.skip --file pom.xml
86+
87+ - name : Run SpotBugs Analysis
88+ if : ${{ github.actor != 'dependabot[bot]' }}
89+ uses : jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e # v1.2
90+ with :
91+ path : ' **/spotbugsXml.xml'
0 commit comments