Skip to content

Commit

Permalink
chore: update build and tooling to utilize new java version
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli committed Feb 11, 2025
1 parent b797883 commit 15ca167
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 234 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ permissions:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
- name: Set up JDK 8
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
Expand All @@ -35,9 +34,9 @@ jobs:
uses: actions/cache@36f1e144e1c8edb0a652766b484448563d8baf46
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-17-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
${{ runner.os }}-17-maven-
- name: Configure GPG Key
run: |
Expand All @@ -60,7 +59,7 @@ jobs:
# Add -SNAPSHOT before deploy
- name: Add SNAPSHOT
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'

- name: Deploy
run: |
mvn --batch-mode \
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
build:
- java: 17
profile: codequality
- java: 8
profile: java8
name: with Java ${{ matrix.build.java }}
runs-on: ${{ matrix.os}}
steps:
- name: Check out the code
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2

- name: Set up JDK 8
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
java-version: '8'
distribution: 'temurin'
cache: maven
java-version: ${{ matrix.build.java }}
distribution: 'temurin'
cache: maven

- name: Initialize CodeQL
uses: github/codeql-action/init@0a35e8f6866a39b001e5f7ad1d0daf9836786896
Expand All @@ -27,15 +36,16 @@ jobs:
- name: Cache local Maven repository
uses: actions/cache@36f1e144e1c8edb0a652766b484448563d8baf46
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
path: ~/.m2/repository
key: ${{ runner.os }}${{ matrix.build.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}${{ matrix.build.java }}-maven-
- name: Verify with Maven
run: mvn --batch-mode --update-snapshots --activate-profiles e2e verify
run: mvn --batch-mode --update-snapshots --activate-profiles e2e,${{ matrix.build.profile }} verify

- name: Upload coverage to Codecov
- if: matrix.build.java == '17'
name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
on:
push:
branches:
- main
- beta/new_java_build
name: Run Release Please
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -23,17 +23,17 @@ jobs:
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
target-branch: beta/new_java_build

# These steps are only run if this was a merged release-please PR
- name: checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
- name: Set up JDK 8
- name: Set up JDK 17
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
Expand All @@ -54,4 +54,4 @@ jobs:
--settings release/m2-settings.xml clean deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Loading

0 comments on commit 15ca167

Please sign in to comment.