Fix to https://github.com/OpenAS2/OpenAs2App/issues/349 #148
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
name: Java CI | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java_version: [8, 11, 13, 17] | |
os: [windows-latest, ubuntu-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v2 | |
with: | |
java-version: ${{ matrix.java_version }} | |
distribution: 'adopt' | |
- name: Remove Rest API for Java 8 because of library incompatibility | |
if: contains(matrix.java_version, '8') == true && contains(matrix.os, 'win') == true | |
run: | | |
rmdir -Recurse -Force Server/src/main/java/org/openas2/cmd/processor/restapi | |
del -Force Server/src/main/java/org/openas2/cmd/processor/RestCommandProcessor.java | |
del -Force Server/src/test/java/org/openas2/app/RestApiTest.java | |
- name: Remove Rest API for Java 8 because of library incompatibility | |
if: contains(matrix.java_version, '8') == true && contains(matrix.os, 'win') == false | |
run: | | |
rm -rf Server/src/main/java/org/openas2/cmd/processor/restapi | |
rm -rf Server/src/main/java/org/openas2/cmd/processor/RestCommandProcessor.java | |
rm -rf Server/src/test/java/org/openas2/app/RestApiTest.java | |
- name: Make Maven Wrapper and Java finder executable. Copy cacerts | |
if: contains(matrix.os, 'win') == false | |
run: | | |
chmod +x ./mvnw | |
chmod +x ./Server/src/bin/find_java | |
. ./Server/src/bin/find_java | |
cert_file=$(find -L $JAVA_HOME -name cacerts) | |
cp -f cacerts $cert_file | |
echo "File at: $cert_file" | |
- name: Update the cacerts in the JDK being used because of Maven repo issues | |
if: contains(matrix.os, 'win') == true | |
run: | | |
.\Server\src\bin\find_java.bat | |
$ENV:cert_file=gci -Path $ENV:JAVA_HOME -Filter cacerts -File -Recurse -ErrorAction SilentlyContinue | %{$_.FullName} | |
copy cacerts "$ENV:cert_file" | |
- name: Build with Maven | |
run: ./mvnw test --file pom.xml --log-file maven.log | |
- name: Archive logs | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: execution-logs-${{ matrix.java_version }}-${{ matrix.os }} | |
path: maven.log | |
retention-days: 1 |