chore: Try to force github actions to check out code with linux line … #10
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
# 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: Unit-Test | |
on: | |
push: | |
branches: | |
- develop | |
- 'rel/*' | |
pull_request: | |
branches: | |
- develop | |
- 'rel/*' | |
# allow manually run the action: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} | |
jobs: | |
unit-test: | |
strategy: | |
fail-fast: false | |
max-parallel: 20 | |
matrix: | |
java: [ 8, 11, 17, 21 ] | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Configure unix line breaks on Windows machines | |
if: ${{ matrix.os == 'windows-latest'}} | |
shell: bash | |
run: | | |
git config --system core.autocrlf false | |
git config --system core.eol lf | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: corretto | |
java-version: ${{ matrix.java }} | |
# Setup caching of the artifacts in the .m2 directory, so they don't have to | |
# all be downloaded again for every build. | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2- | |
# On Windows systems the 'mvnw' script needs an additional ".cmd" appended. | |
- name: Calculate platform suffix | |
id: platform_suffix | |
uses: actions/[email protected] | |
env: | |
OS: ${{ matrix.os }} | |
with: | |
script: | | |
const { OS } = process.env | |
if (OS.includes("windows")) { | |
core.setOutput('platform_suffix', `.cmd`) | |
} else { | |
core.setOutput('platform_suffix', ``) | |
} | |
# Spotless doesn't work on Windows due to the different line endings. | |
#- name: Build and test with Maven (Windows) | |
# if: ${{ matrix.os == 'windows-latest'}} | |
# shell: bash | |
# run: ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} clean verify -Pspotless.skip=true | |
- name: Build and test with Maven (All others) | |
shell: bash | |
#if: ${{ matrix.os != 'windows-latest'}} | |
run: ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} clean verify |