Skip to content

Commit

Permalink
[GHA] Rewrite github actions to support older maven / java 7 runs
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Dec 2, 2023
1 parent 5b8d8a7 commit 2272f8c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
uses: actions/checkout@v4

- name: Set up Java and Maven
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven

- name: Build with Maven
run: ./mvnw -B verify
run: ./mvnw -B -V verify --no-transfer-progress

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -29,7 +29,7 @@ jobs:

strategy:
matrix:
java: [7, 8, 11, 17, 21]
java: [8, 11, 17, 21, 22-ea]

name: Java ${{ matrix.java }} Compatibility

Expand All @@ -38,14 +38,40 @@ jobs:
uses: actions/checkout@v4

- name: Set up Java and Maven
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven

- name: Test with Maven
run: ./mvnw -B -V test

compatibility-checks-java7-maven354:
runs-on: ubuntu-latest

strategy:
matrix:
java: [7]

name: Java ${{ matrix.java }} Compatibility with Maven 3.5.4

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven

- name: Load Maven 3.5.4
run: mvn -B -V io.takari:maven:0.5.0:wrapper -Dmaven=3.5.4 --no-transfer-progress

- name: Test with Maven
run: ./mvnw -B test
run: ./mvnw -B -V test

deploy:
name: Deploy to OSSRH
Expand All @@ -58,17 +84,17 @@ jobs:
uses: actions/checkout@v4

- name: Set up Java and Maven
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
cache: maven

- name: Set up Java and Maven
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
Expand All @@ -77,7 +103,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish Maven package
run: ./mvnw -Possrh-deploy deploy
run: ./mvnw -B -V -Possrh-deploy deploy --no-transfer-progress
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
MAVEN_USERNAME: ${{ secrets.nexus_username }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: maven

- name: Build with Maven
run: ./mvnw -B site
run: ./mvnw -B -V site --no-transfer-progress

- name: Publish site to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit 2272f8c

Please sign in to comment.