Skip to content

Commit

Permalink
[104] Add a nightly job to test against newer versions of Java and co…
Browse files Browse the repository at this point in the history
…mpile tests to the bytecode of the version being used.

Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Jan 9, 2025
1 parent 613b7af commit 7eb922d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: WildFly Glow - Nightly CI

on:
push:
branches:
- 'main'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/nightly-ci.yml'

schedule:
- cron: '0 3 * * *' # Every day at 03:00 UTC


jobs:
nightly-build:
name: ${{ matrix.os }}-jdk${{ matrix.java.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
java: [{version: '17', release: '17'} , {version: '21', release: '21'}, {version: '23', release: '23'}, {version: '24-ea', release: '24'}]

steps:
- uses: actions/checkout@v4
with:
path: wildfly-glow
- uses: actions/checkout@v4
with:
repository: wildfly/wildfly-maven-plugin
path: wildfly-maven-plugin
- name: Set up JDK ${{ matrix.java.version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java.version }}
cache: 'maven'
distribution: 'temurin'
- name: Build and Test on ${{ matrix.java.version }} with tests compiled to ${{ matrix.java.version }}
run: mvn clean install '-Dtest.maven.compiler.release=${{ matrix.java.release }}'
working-directory: wildfly-glow
- name: Run cli tests using bash
run: bash tests/run-cli-tests.sh
shell: bash
working-directory: wildfly-glow
- name: Retrieve WildFly Glow version
shell: bash
run: |
echo "WILDFLY_GLOW_VERSION=$(mvn -B help:evaluate -Dexpression=project.version -DforceStdout -q)" >> $GITHUB_ENV
working-directory: wildfly-glow
- name: Build and Test WildFly Maven Plugin on ${{ matrix.java.version }}
# Uses an empty WildFly version to provision the latest version of WildFly
run: mvn clean install -Dversion.org.wildfly.glow=${{ env.WILDFLY_GLOW_VERSION }} -Dversion.org.wildfly=
shell: bash
working-directory: wildfly-maven-plugin
- uses: actions/upload-artifact@v4
if: failure()
with:
name: surefire-reports-${{ matrix.os }}-${{ matrix.java.version }}
path: |
!**/target/**
**/surefire-reports/*.txt
18 changes: 16 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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>
<!-- Used to override the release bytecode for compiling tests. This allows testing on newer bytecode. -->
<test.maven.compiler.release>${maven.compiler.release}</test.maven.compiler.release>
<wildfly.glow.galleon.feature-packs.url>https://raw.githubusercontent.com/wildfly/wildfly-galleon-feature-packs/release/</wildfly.glow.galleon.feature-packs.url>

<!-- versions -->
Expand Down Expand Up @@ -139,6 +142,17 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<release>${test.maven.compiler.release}</release>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down

0 comments on commit 7eb922d

Please sign in to comment.