Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI to work with Java 17+ and use the maven.compliler.release property #1713

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 18 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,25 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build-all:
name: Compile (no tests) with JDK 11
runs-on: ubuntu-latest
steps:
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
m2-
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
cache: 'maven'
- name: Build
run: mvn -U -B -fae -DskipTests -Dfindbugs clean install
run: mvn -V -U -B -fae -DskipTests -Dfindbugs clean install
- name: Tar Maven Repo
shell: bash
run: tar -czf maven-repo.tgz -C ~ .m2/repository
Expand Down Expand Up @@ -77,13 +68,10 @@ jobs:
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: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
Expand All @@ -93,18 +81,13 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.openjdk_impl }}
java-version: ${{ matrix.jdk }}
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
cache: 'maven'
- name: Run Tests
run: mvn -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }}
run: mvn -V -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }} '-P-java${{ matrix.jdk }}-test-classpath'
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand All @@ -130,13 +113,10 @@ jobs:
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"
sudo sysctl -w fs.file-max=2097152
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Host information
run: |
hostname || true
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download Maven Repo
uses: actions/download-artifact@v4
with:
Expand All @@ -146,17 +126,13 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up JDK ${{ matrix.java }}
uses: joschi/setup-jdk@v2
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
- name: Generate settings.xml for Maven Builds
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]'
- name: Print Version
run: mvn -v
distribution: 'temurin'
cache: 'maven'
- name: Run Tests
run: mvn -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true
run: mvn -V -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true '-P-java${{ matrix.jdk }}-test-classpath'
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@
<version.bundle.plugin>5.1.1</version.bundle.plugin>

<version.jmh>1.21</version.jmh>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
<maven.javadoc.plugin.quiet>true</maven.javadoc.plugin.quiet>
<maven.compiler.showDeprecation>false</maven.compiler.showDeprecation>
<maven.compiler.showWarnings>false</maven.compiler.showWarnings>
Expand Down Expand Up @@ -182,7 +183,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<!-- fork is needed so compiler args can be used -->
<fork>true</fork>
Expand Down
Loading