Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Action PRB to test Maven builds (pom.xml) #232

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

60 changes: 60 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -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