Skip to content

Commit cf6a8c3

Browse files
committed
Testing: add Linux 32-bit testing with Java 17
1 parent b3daca0 commit cf6a8c3

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/linux-32bit.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Linux 32-bit Build and Test
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ 'master' ]
8+
9+
jobs:
10+
# Linux 32-bit build using Zulu x86 JDK
11+
# Tests JNI pointer handling and 32-bit specific code paths
12+
linux-32bit:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
jdk_version: [ '17' ]
17+
wolfssl_configure: [ '--enable-jni --disable-asm', '--enable-jni --enable-all --disable-asm' ]
18+
name: Linux x86 32-bit (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure }})
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
# Install 32-bit library support for running x86 binaries on x64 runner
24+
- name: Install 32-bit library support
25+
run: |
26+
sudo dpkg --add-architecture i386
27+
sudo apt-get update
28+
sudo apt-get install -y \
29+
gcc-multilib \
30+
g++-multilib \
31+
libc6:i386 \
32+
libstdc++6:i386 \
33+
zlib1g:i386
34+
35+
- name: Setup Java (Zulu 32-bit)
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: 'zulu'
39+
java-version: ${{ matrix.jdk_version }}
40+
architecture: x86
41+
42+
- name: Verify Java installation
43+
run: |
44+
java -version
45+
file $(which java)
46+
47+
- name: Cache JUnit dependencies
48+
uses: actions/cache@v4
49+
id: cache-junit
50+
with:
51+
path: junit
52+
key: junit-jars-v1
53+
54+
- name: Download junit-4.13.2.jar
55+
if: steps.cache-junit.outputs.cache-hit != 'true'
56+
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar
57+
58+
- name: Download hamcrest-all-1.3.jar
59+
if: steps.cache-junit.outputs.cache-hit != 'true'
60+
run: wget --directory-prefix=$GITHUB_WORKSPACE/junit https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar
61+
62+
- name: Clone and build wolfSSL (32-bit)
63+
run: |
64+
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git /tmp/wolfssl
65+
cd /tmp/wolfssl
66+
./autogen.sh
67+
./configure ${{ matrix.wolfssl_configure }} \
68+
--prefix=$GITHUB_WORKSPACE/wolfssl-install \
69+
CFLAGS="-m32" LDFLAGS="-m32"
70+
make
71+
make install
72+
73+
- name: Set environment variables
74+
run: |
75+
echo "JUNIT_HOME=$GITHUB_WORKSPACE/junit" >> $GITHUB_ENV
76+
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib" >> $GITHUB_ENV
77+
78+
- name: Build JNI library (32-bit)
79+
run: |
80+
CFLAGS="-m32" LDFLAGS="-m32" ./java.sh $GITHUB_WORKSPACE/wolfssl-install
81+
82+
- name: Build JAR (ant)
83+
run: ant
84+
85+
- name: Run Java tests (ant test)
86+
run: ant test
87+
88+
- name: Show logs on failure
89+
if: failure() || cancelled()
90+
run: |
91+
cat build/reports/*.txt 2>/dev/null || true
92+

0 commit comments

Comments
 (0)