From 978f0f26bb470142c2aa298d57f56162a871551a Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Mon, 7 Apr 2025 18:36:01 +0100 Subject: [PATCH 01/10] workflow: moved workflow to root folder --- {maven-spring/.github => .github}/workflows/ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {maven-spring/.github => .github}/workflows/ci.yml (100%) diff --git a/maven-spring/.github/workflows/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from maven-spring/.github/workflows/ci.yml rename to .github/workflows/ci.yml From c78f22ae21e586cfa105005a637f27053c58e1a2 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Mon, 7 Apr 2025 18:52:10 +0100 Subject: [PATCH 02/10] workflow: update workflow structure and versions --- .github/workflows/ci.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37329fd..96d7e0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,16 +14,19 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4.2.2 + with: + sparse-checkout: | + maven-spring - name: Set up JDK 21 (Temurin) - uses: actions/setup-java@v3 + uses: actions/setup-java@v4.7.0 with: java-version: '21' distribution: 'temurin' - name: Cache Maven packages - uses: actions/cache@v3 + uses: actions/cache@v4.2.3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -35,6 +38,11 @@ jobs: - name: Compile code run: mvn compile + test: + runs-on: ubuntu-latest + needs: build + + steps: - name: Run tests run: mvn test @@ -43,16 +51,13 @@ jobs: needs: build steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v2.21.0 with: languages: java-kotlin - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v2.21.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v2.21.0 From 1b5d2d0aeda77ee7db26711bb3c43f51bde640a4 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Mon, 7 Apr 2025 19:04:53 +0100 Subject: [PATCH 03/10] workflow: update the dependencies --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96d7e0c..24759c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: restore-keys: ${{ runner.os }}-maven- - name: Format code with Spotless - run: mvn spotless:apply + run: mvn spotless:apply -U - name: Compile code run: mvn compile From 266190104baff303ee4c825e296b7a93f64afdbf Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Mon, 7 Apr 2025 19:09:03 +0100 Subject: [PATCH 04/10] workflow: update order of workflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24759c9..4c8e571 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,12 +32,12 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - - name: Format code with Spotless - run: mvn spotless:apply -U - - name: Compile code run: mvn compile + - name: Format code with Spotless + run: mvn spotless:apply -U + test: runs-on: ubuntu-latest needs: build From 03e5bc9d508200890afdb1a700638bf757b8f983 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 10:06:17 +0100 Subject: [PATCH 05/10] workflow: improve github checks --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c8e571..e58cefb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,13 @@ jobs: - name: Compile code run: mvn compile - - name: Format code with Spotless - run: mvn spotless:apply -U + format: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Check code formatting + run: mvn spotless:check test: runs-on: ubuntu-latest From 488e4ca47a70f2a2c211882692081d32ad3971e8 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 10:46:01 +0100 Subject: [PATCH 06/10] workflow: specify the working directory for the github actions --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e58cefb..1a6557c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: restore-keys: ${{ runner.os }}-maven- - name: Compile code - run: mvn compile + run: mvn compile -f maven-spring/pom.xml format: runs-on: ubuntu-latest @@ -41,7 +41,7 @@ jobs: steps: - name: Check code formatting - run: mvn spotless:check + run: mvn spotless:check -f maven-spring/pom.xml test: runs-on: ubuntu-latest @@ -49,7 +49,7 @@ jobs: steps: - name: Run tests - run: mvn test + run: mvn test -f maven-spring/pom.xml codeql: runs-on: ubuntu-latest @@ -60,9 +60,14 @@ jobs: uses: github/codeql-action/init@v2.21.0 with: languages: java-kotlin + source-root: maven-spring - name: Autobuild uses: github/codeql-action/autobuild@v2.21.0 + with: + working-directory: maven-spring - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2.21.0 + with: + output: maven-spring/results From 00b201a945c2ff0e5ab2770bdb7ee99216efe424 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 15:42:56 +0100 Subject: [PATCH 07/10] workflow: add checkout to each step --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a6557c..c313c4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,12 @@ jobs: needs: build steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + with: + sparse-checkout: | + maven-spring + - name: Check code formatting run: mvn spotless:check -f maven-spring/pom.xml @@ -48,6 +54,12 @@ jobs: needs: build steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + with: + sparse-checkout: | + maven-spring + - name: Run tests run: mvn test -f maven-spring/pom.xml @@ -56,6 +68,12 @@ jobs: needs: build steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + with: + sparse-checkout: | + maven-spring + - name: Initialize CodeQL uses: github/codeql-action/init@v2.21.0 with: From 0b133eb9872cd5702d49faee8b07fb6c3fa4d483 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 15:53:00 +0100 Subject: [PATCH 08/10] workflow: add java setup for each single job --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c313c4e..3cb0722 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,19 @@ jobs: sparse-checkout: | maven-spring + - name: Set up JDK 21 (Temurin) + uses: actions/setup-java@v4.7.0 + with: + java-version: '21' + distribution: 'temurin' + + - name: Cache Maven packages + uses: actions/cache@v4.2.3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + - name: Check code formatting run: mvn spotless:check -f maven-spring/pom.xml @@ -60,7 +73,20 @@ jobs: sparse-checkout: | maven-spring - - name: Run tests + - name: Set up JDK 21 (Temurin) + uses: actions/setup-java@v4.7.0 + with: + java-version: '21' + distribution: 'temurin' + + - name: Cache Maven packages + uses: actions/cache@v4.2.3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + - name: Rclearun tests run: mvn test -f maven-spring/pom.xml codeql: @@ -74,6 +100,19 @@ jobs: sparse-checkout: | maven-spring + - name: Set up JDK 21 (Temurin) + uses: actions/setup-java@v4.7.0 + with: + java-version: '21' + distribution: 'temurin' + + - name: Cache Maven packages + uses: actions/cache@v4.2.3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + - name: Initialize CodeQL uses: github/codeql-action/init@v2.21.0 with: From 7f30cb3d3c0a771d67f2b86e0687c468341ac6f3 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 16:02:11 +0100 Subject: [PATCH 09/10] workflow: add security permissions for codeql --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cb0722..fa109b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,8 @@ jobs: codeql: runs-on: ubuntu-latest needs: build + permissions: + security-events: write steps: - name: Checkout code From ae036844d52566286b9c47a1c324d5933d89c9a5 Mon Sep 17 00:00:00 2001 From: Paulo Oliveira Date: Tue, 8 Apr 2025 16:10:01 +0100 Subject: [PATCH 10/10] workflow: change codeql language --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa109b6..0162b8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v2.21.0 with: - languages: java-kotlin + languages: java source-root: maven-spring - name: Autobuild