Bump org.junit.platform:junit-platform-launcher from 1.11.1 to 1.11.2… #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build a Java project with Gradle for every push. | |
# Based upon https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle. | |
# TODO: | |
# * Add test support. | |
name: Build for every push | |
# Run this on every push to the `master` branch. | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
# The Ubuntu-based build job. | |
buildLinux: | |
runs-on: ubuntu-latest | |
# Our global environment variables used as a replacement for providing an `oc_okapi.properties` file. | |
env: | |
OC_OKAPI_DE_CONSUMER_KEY: ${{ secrets.OC_OKAPI_DE_CONSUMER_KEY }} | |
OC_OKAPI_DE_CONSUMER_SECRET: ${{ secrets.OC_OKAPI_DE_CONSUMER_SECRET }} | |
# Run compilation tests. | |
# EOL: https://adoptium.net/support/ and https://endoflife.date/oracle-jdk | |
# The format checker requires at least Java 11, while the other ones are more recent. | |
# Please note that we still support Java versions starting with Java 8, but we cannot compile our | |
# code with Java 8 as they miss the newer APIs we reference inside the `Compatibility.java` file. | |
strategy: | |
matrix: | |
java: [11, 17, 21, GA] | |
# Make sure to always run for all Java versions to sort out possible incompatibilities. | |
# Example: Gradle might not yet support the GA/EA releases, as indicated by | |
# https://docs.gradle.org/current/userguide/compatibility.html | |
fail-fast: false | |
# Use a better name. | |
name: Linux Build with Java ${{ matrix.java }} | |
# The actual build process. | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Use OpenJDK from https://jdk.java.net/. | |
# See https://github.com/oracle-actions/setup-java. | |
# This action only supports the latest release, see https://github.com/oracle-actions/setup-java/issues/14. | |
# For this reason, all other builds happen with the https://github.com/actions/setup-java action. | |
- name: Download JDK (jdk.java.net) | |
uses: oracle-actions/setup-java@v1 | |
id: jdk | |
with: | |
website: jdk.java.net | |
release: ${{ matrix.java }} | |
if: ${{ contains(fromJson('["GA", "EA"]'), matrix.java) }} | |
- name: Download JDK (Eclipse) | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
if: ${{ !contains(fromJson('["GA", "EA"]'), matrix.java) }} | |
- name: Display Java Version | |
run: java --version | |
# Cache some Gradle files. | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Cache Gradle Packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
# Run the actual steps after the preparations. | |
- name: Grant Execute Permission for gradlew | |
run: chmod +x gradlew | |
- name: Clean Build Area | |
run: ./gradlew clean | |
- name: Verify Code Format | |
run: ./gradlew verifyGoogleJavaFormat | |
- name: Build JAR | |
run: ./gradlew jar | |
# Clean some files before caching. | |
- name: Cache Cleanup | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -fr ~/.gradle/caches/*/plugin-resolution/ | |
# Upload the artifact to access it for deployment. | |
- name: Upload Artifact | |
if: ${{ matrix.java == 'GA' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cm-ci.jar | |
path: build/libs/cm-ci.jar | |
# The Windows-based build job. | |
buildWindows: | |
runs-on: windows-latest | |
# Our global environment variables used as a replacement for providing an `oc_okapi.properties` file. | |
env: | |
OC_OKAPI_DE_CONSUMER_KEY: ${{ secrets.OC_OKAPI_DE_CONSUMER_KEY }} | |
OC_OKAPI_DE_CONSUMER_SECRET: ${{ secrets.OC_OKAPI_DE_CONSUMER_SECRET }} | |
# Run compilation tests. | |
# The format checker requires at least Java 11. | |
# Please note that we still support Java versions starting with Java 8, but we cannot compile our | |
# code with Java 8 as they miss the newer APIs we reference inside the `Compatibility.java` file. | |
# NOTE: We only use the GA release here, as this should be enough for now. | |
strategy: | |
matrix: | |
java: [GA] | |
# Use a better name. | |
name: Windows Build with Java ${{ matrix.java }} | |
# The actual build process. | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Use OpenJDK from https://jdk.java.net/. | |
# See https://github.com/oracle-actions/setup-java. | |
# This action only supports the latest release, see https://github.com/oracle-actions/setup-java/issues/14. | |
# For this reason, all other builds happen with the https://github.com/actions/setup-java action. | |
- name: Download JDK (jdk.java.net) | |
uses: oracle-actions/setup-java@v1 | |
id: jdk | |
with: | |
website: jdk.java.net | |
release: ${{ matrix.java }} | |
- name: Display Java Version | |
run: java --version | |
# Cache some Gradle files. | |
- name: Cache Gradle Wrapper | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Cache Gradle Packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
# Run the actual steps after the preparations. | |
- name: Clean Build Area | |
run: ./gradlew clean | |
- name: Verify Code Format | |
run: ./gradlew verifyGoogleJavaFormat | |
- name: Build JAR | |
run: ./gradlew jar | |
# Clean some files before caching. | |
# We have to stop the Gradle daemon beforehand, as the `modules-2.lock` file would be locked otherwise. | |
- name: Cache Cleanup | |
run: | | |
./gradlew --stop | |
rm ~/.gradle/caches/modules-2/modules-2.lock | |
rm -r ~/.gradle/caches/*/plugin-resolution | |
# Deploy the pre-release. | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy Pre-Release | |
# Run after the build. | |
needs: buildLinux | |
# Perform the deployment. | |
steps: | |
# Delete the old pre-release. | |
# https://github.com/marketplace/actions/rollback-release | |
- name: Delete old Pre-Release | |
uses: author/action-rollback@master | |
with: | |
tag: prerelease | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Retrieve some environment variables. | |
# Please note that we cannot use `git rev-parse --short HEAD` for the short commit hash here, as we do not checkout | |
# the code in this job. | |
- name: Retrieve Long Commit Hash | |
run: echo "LONG_HASH=$(echo $GITHUB_SHA)" >> $GITHUB_ENV | |
- name: Retrieve Short Commit Hash | |
run: echo "SHORT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV | |
- name: Retrieve Timestamp | |
run: echo "TIMESTAMP=$(date +'%F %T %Z')" >> $GITHUB_ENV | |
# Download the artifact and rename it. | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: cm-ci.jar | |
path: artifacts/ | |
- name: Rename Artifact | |
run: | |
mv artifacts/cm-ci.jar artifacts/cm-${{ env.SHORT_HASH }}.jar | |
# Create the pre-release with the artifact. | |
# https://github.com/ncipollo/release-action | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: prerelease | |
name: Development build | |
body: | | |
Automated build of the master branch (commit ${{ env.LONG_HASH }}) using GitHub Actions on ${{ env.TIMESTAMP }}. | |
draft: false | |
prerelease: true | |
artifacts: artifacts/cm-${{ env.SHORT_HASH }}.jar | |
artifactContentType: application/x-java-archive |