Skip to content

Commit

Permalink
Merge pull request #22 from liweinan/add_java_21_ci
Browse files Browse the repository at this point in the history
Add Java 17 and 21 to CI
  • Loading branch information
liweinan authored Jan 4, 2024
2 parents 96500fd + 3975e80 commit fb60d84
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ name: JBeret JPA Repository CI

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
types: [ opened, synchronize, reopened, ready_for_review ]
push:
branches: [ main ]

jobs:
build-test-matrix:
Expand All @@ -15,31 +19,31 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
jdk-distribution: [temurin]
jdk-version: [11]
os: [ ubuntu-latest, windows-latest ]
jdk-distribution: [ temurin ]
jdk-version: [ 11, 17, 21 ]
steps:
- name: Configure runner - Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
- name: Configure Runner - Windows
if: contains(matrix.os, 'windows')
run: |
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts
echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts
shell: cmd
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk-distribution }} ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.jdk-distribution }}
java-version: ${{ matrix.jdk-version }}
- name: Run Tests
run: mvn -ntp -U -B -fae clean install
- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-${{ matrix.jdk-distribution }}-${{ matrix.jdk-version }}-${{ matrix.os }}
path: '**/surefire-reports/*.txt'
- name: Configure runner - Linux
if: contains(matrix.os, 'ubuntu')
run: |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
- name: Configure Runner - Windows
if: contains(matrix.os, 'windows')
run: |
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts
echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts
shell: cmd
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk-distribution }} ${{ matrix.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.jdk-distribution }}
java-version: ${{ matrix.jdk-version }}
- name: Run Tests
run: mvn -ntp -U -B -fae clean install
- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-${{ matrix.jdk-distribution }}-${{ matrix.jdk-version }}-${{ matrix.os }}
path: '**/surefire-reports/*.txt'

0 comments on commit fb60d84

Please sign in to comment.