|
| 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: Copy makefile |
| 79 | + run: cp makefile.linux makefile |
| 80 | + |
| 81 | + - name: Build JNI library (32-bit) |
| 82 | + run: CCFLAGS="-m32" LDFLAGS="-m32" PREFIX=$GITHUB_WORKSPACE/wolfssl-install make |
| 83 | + |
| 84 | + # ant build-jni-debug |
| 85 | + - name: Build JAR (ant build-jni-debug) |
| 86 | + run: ant build-jni-debug |
| 87 | + - name: Run Java tests (ant test) |
| 88 | + run: ant test |
| 89 | + - name: Clean JAR |
| 90 | + run: ant clean |
| 91 | + |
| 92 | + # ant build-jni-release |
| 93 | + - name: Build JAR (ant build-jni-release) |
| 94 | + run: ant build-jni-release |
| 95 | + - name: Run Java tests (ant test) |
| 96 | + run: ant test |
| 97 | + - name: Clean JAR |
| 98 | + run: ant clean |
| 99 | + |
| 100 | + # ant build-jce-debug |
| 101 | + - name: Build JAR (ant build-jce-debug) |
| 102 | + run: ant build-jce-debug |
| 103 | + - name: Run Java tests (ant test) |
| 104 | + run: ant test |
| 105 | + - name: Clean JAR |
| 106 | + run: ant clean |
| 107 | + |
| 108 | + # ant build-jce-release |
| 109 | + - name: Build JAR (ant build-jce-release) |
| 110 | + run: ant build-jce-release |
| 111 | + - name: Run Java tests (ant test) |
| 112 | + run: ant test |
| 113 | + - name: Clean JAR |
| 114 | + run: ant clean |
| 115 | + |
| 116 | + - name: Show logs on failure |
| 117 | + if: failure() || cancelled() |
| 118 | + run: | |
| 119 | + cat build/reports/*.txt 2>/dev/null || true |
| 120 | +
|
0 commit comments