103 lines
3.0 KiB
YAML
103 lines
3.0 KiB
YAML
name: Common Linux test logic
|
|
|
|
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: Setup JUnit
|
|
uses: ./.github/actions/setup-junit
|
|
|
|
# Cache the installed wolfSSL build. It depends only on the wolfSSL
|
|
# commit, configure flags, OS/arch and compiler, not on the JDK in
|
|
# use, so jobs across the matrix (and other workflows) can share
|
|
# one build.
|
|
- name: Build native wolfSSL (cached)
|
|
uses: ./.github/actions/build-wolfssl-cached
|
|
with:
|
|
configure: ${{ inputs.wolfssl_configure }}
|
|
|
|
- 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"
|
|
|
|
# Only copy appropriate makefile for platform currently being tested.
|
|
# Use 'cat > ' rather than 'cp': macOS runners intermittently fail 'cp'
|
|
# with "fcopyfile failed: Illegal byte sequence" when copyfile() tries to
|
|
# replicate the source's extended attributes (e.g. com.apple.provenance).
|
|
# Redirecting content copies only the file data and avoids that path.
|
|
- name: Copy makefile
|
|
run: |
|
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
|
cat makefile.linux > makefile
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
|
cat makefile.macosx > makefile
|
|
else
|
|
echo "$RUNNER_OS not supported"
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Build JNI library
|
|
run: PREFIX=$GITHUB_WORKSPACE/build-dir make
|
|
|
|
# ant build-jni-debug
|
|
- name: Build jce-debug JAR (ant build-jni-debug)
|
|
run: ant build-jni-debug
|
|
- name: Run Java tests (ant test)
|
|
run: ant test
|
|
- name: Clean JAR
|
|
run: ant clean
|
|
|
|
# ant build-jni-release
|
|
- name: Build jce-debug JAR (ant build-jni-release)
|
|
run: ant build-jni-release
|
|
- name: Run Java tests (ant test)
|
|
run: ant test
|
|
- name: Clean JAR
|
|
run: ant clean
|
|
|
|
# ant build-jce-debug
|
|
- name: Build jce-debug JAR (ant build-jce-debug)
|
|
run: ant build-jce-debug
|
|
- name: Run Java tests (ant test)
|
|
run: ant test
|
|
- name: Clean JAR
|
|
run: ant clean
|
|
|
|
# ant build-jce-release
|
|
- name: Build jce-debug JAR (ant build-jce-release)
|
|
run: ant build-jce-release
|
|
- name: Run Java tests (ant test)
|
|
run: ant test
|
|
- name: Clean JAR
|
|
run: ant clean
|
|
|
|
- name: Show logs on failure
|
|
if: failure() || cancelled()
|
|
run: |
|
|
cat build/reports/*.txt
|