Skip to content

Javax to jakarta cleanup plus other stuff #182

Javax to jakarta cleanup plus other stuff

Javax to jakarta cleanup plus other stuff #182

Workflow file for this run

name: Java CI
on: [pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java_version: [8, 11, 17, 21]
os: [windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
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 clean -e --debug --file pom.xml --log-file maven.log
./mvnw test -e --debug --file pom.xml --log-file maven.log
- name: Archive logs
uses: actions/upload-artifact@v4
if: always()
with:
name: execution-logs-${{ matrix.java_version }}-${{ matrix.os }}
path: maven.log
retention-days: 1