From 3f96219d8e4af527ec01ac39bb1fa216ce0285eb Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Mon, 11 Nov 2024 14:34:26 -0700 Subject: [PATCH] Add GitHub Action PRB to test Maven builds (pom.xml) --- .github/workflows/main.yml | 17 +++++++++++ .github/workflows/maven.yml | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e69cbaf9..90c900d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -133,3 +133,20 @@ jobs: jdk_distro: "zulu" jdk_version: ${{ matrix.jdk_version }} + # --------------------- Maven build - test pom.xml -------------------- + # Run Maven build over PR code, running on Linux and Mac with only one + # JDK/version for now. + maven-build: + strategy: + matrix: + os: [ 'ubuntu-latest', 'macos-latest' ] + jdk_version: [ '21' ] + wolfssl_configure: [ '--enable-jni' ] + name: Maven Build (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }}) + uses: ./.github/workflows/maven.yml + with: + os: ${{ matrix.os }} + jdk_distro: "zulu" + jdk_version: ${{ matrix.jdk_version }} + wolfssl_configure: ${{ matrix.wolfssl_configure }} + diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..1424e697 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,60 @@ +name: Maven Build (pom.xml) + +on: + workflow_call: + inputs: + os: + required: true + type: string + jdk_distro: + required: true + type: string + jdk_version: + required: true + type: string + wolfssl_configure: + required: true + type: string + +jobs: + build_wolfcryptjni: + runs-on: ${{ inputs.os }} + steps: + - uses: actions/checkout@v4 + + - name: Build native wolfSSL + uses: wolfSSL/actions-build-autotools-project@v1 + with: + repository: wolfSSL/wolfssl + ref: master + path: wolfssl + configure: ${{ inputs.wolfssl_configure }} + check: false + install: true + + - name: Setup java + uses: actions/setup-java@v4 + with: + distribution: ${{ inputs.jdk_distro }} + java-version: ${{ inputs.jdk_version }} + + - name: Set LD_LIBRARY_PATH + run: | + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib" >> "$GITHUB_ENV" + + - name: Build JNI library + run: ./java.sh $GITHUB_WORKSPACE/build-dir + + # Maven build + - name: mvn compile + run: mvn compile + + - name: mvn test + run: mvn test + + - name: mvn package + run: mvn package + + - name: mvn clean + run: mvn clean +