|
6 | 6 | branches: [ '*' ] |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - # Oracle JDK (Linux, Mac) |
10 | | - # Oracle JDK requires JAR to be signed for some classes to load/run |
11 | | - # properly, for example KeyAgreement. These tests are commented out |
12 | | - # here until we get a solution in place for CI JAR signing |
13 | | - #linux-oracle: |
14 | | - # strategy: |
15 | | - # matrix: |
16 | | - # os: [ 'ubuntu-latest', 'macos-latest' ] |
17 | | - # jdk_version: [ '17', '21' ] |
18 | | - # wolfssl_configure: [ '--enable-jni' ] |
19 | | - # name: ${{ matrix.os }} (Oracle JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
20 | | - # uses: ./.github/workflows/linux-common.yml |
21 | | - # with: |
22 | | - # os: ${{ matrix.os }} |
23 | | - # jdk_distro: "oracle" |
24 | | - # jdk_version: ${{ matrix.jdk_version }} |
25 | | - # wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 9 | + # --------------- Windows Visual Studio build ---------------------- |
| 10 | + # Test building wolfcrypt-jni on Windows with Visual Studio using |
| 11 | + # the solution and project files in ./IDE/WIN (Normal wolfSSL non-FIPS) |
| 12 | + windows-vs-build: |
| 13 | + runs-on: windows-latest |
| 14 | + name: Windows Visual Studio (Normal wolfSSL non-FIPS) |
26 | 15 |
|
27 | | - # Zulu JDK (Linux, Mac) |
28 | | - linux-zulu: |
29 | | - strategy: |
30 | | - matrix: |
31 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
32 | | - jdk_version: [ '8', '11', '17', '21' ] |
33 | | - wolfssl_configure: [ '--enable-jni' ] |
34 | | - name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
35 | | - uses: ./.github/workflows/linux-common.yml |
36 | | - with: |
37 | | - os: ${{ matrix.os }} |
38 | | - jdk_distro: "zulu" |
39 | | - jdk_version: ${{ matrix.jdk_version }} |
40 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + path: wolfcryptjni |
41 | 20 |
|
42 | | - # Corretto JDK (Linux, Mac) |
43 | | - linux-corretto: |
44 | | - strategy: |
45 | | - matrix: |
46 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
47 | | - jdk_version: [ '8', '11', '17', '21' ] |
48 | | - wolfssl_configure: [ '--enable-jni' ] |
49 | | - name: ${{ matrix.os }} (Corretto JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
50 | | - uses: ./.github/workflows/linux-common.yml |
51 | | - with: |
52 | | - os: ${{ matrix.os }} |
53 | | - jdk_distro: "corretto" |
54 | | - jdk_version: ${{ matrix.jdk_version }} |
55 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 21 | + - name: Checkout wolfSSL |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + repository: wolfSSL/wolfssl |
| 25 | + ref: master |
| 26 | + path: wolfssl |
56 | 27 |
|
57 | | - # Temurin JDK (Linux, Mac) |
58 | | - # JDK 8 seems to have been removed from Temurin macos, with 8 we see the error |
59 | | - # Could not find satisfied version for SemVer '8' |
60 | | - linux-temurin: |
61 | | - strategy: |
62 | | - matrix: |
63 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
64 | | - jdk_version: [ '11', '17', '21' ] |
65 | | - wolfssl_configure: [ '--enable-jni' ] |
66 | | - name: ${{ matrix.os }} (Temurin JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
67 | | - uses: ./.github/workflows/linux-common.yml |
68 | | - with: |
69 | | - os: ${{ matrix.os }} |
70 | | - jdk_distro: "temurin" |
71 | | - jdk_version: ${{ matrix.jdk_version }} |
72 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 28 | + - name: Setup MSBuild |
| 29 | + uses: microsoft/setup-msbuild@v2 |
| 30 | + with: |
| 31 | + msbuild-architecture: x64 |
73 | 32 |
|
74 | | - # Microsoft JDK (Linux, Mac) |
75 | | - linux-microsoft: |
76 | | - strategy: |
77 | | - matrix: |
78 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
79 | | - jdk_version: [ '11.0.19', '17.0.7', '21.0.0' ] |
80 | | - wolfssl_configure: [ '--enable-jni' ] |
81 | | - name: ${{ matrix.os }} (Microsoft JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
82 | | - uses: ./.github/workflows/linux-common.yml |
83 | | - with: |
84 | | - os: ${{ matrix.os }} |
85 | | - jdk_distro: "microsoft" |
86 | | - jdk_version: ${{ matrix.jdk_version }} |
87 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 33 | + - name: Setup Java |
| 34 | + uses: actions/setup-java@v4 |
| 35 | + with: |
| 36 | + distribution: 'zulu' |
| 37 | + java-version: '11' |
88 | 38 |
|
89 | | - # -------------------- enable-all sanity checks ----------------------- |
90 | | - # Only check one Linux and Mac JDK version with --enable-jni --enable-all |
91 | | - # as sanity. Using Zulu, but this can be expanded if needed. |
92 | | - linux-zulu-all: |
93 | | - strategy: |
94 | | - matrix: |
95 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
96 | | - jdk_version: [ '11' ] |
97 | | - wolfssl_configure: [ '--enable-jni --enable-all' ] |
98 | | - name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
99 | | - uses: ./.github/workflows/linux-common.yml |
100 | | - with: |
101 | | - os: ${{ matrix.os }} |
102 | | - jdk_distro: "zulu" |
103 | | - jdk_version: ${{ matrix.jdk_version }} |
104 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 39 | + - name: Setup Apache Ant |
| 40 | + run: | |
| 41 | + Invoke-WebRequest -Uri "https://dlcdn.apache.org/ant/binaries/apache-ant-1.10.14-bin.zip" -OutFile "ant.zip" |
| 42 | + Expand-Archive -Path "ant.zip" -DestinationPath "C:\" |
| 43 | + echo "ANT_HOME=C:\apache-ant-1.10.14" >> $env:GITHUB_ENV |
| 44 | + echo "C:\apache-ant-1.10.14\bin" >> $env:GITHUB_PATH |
105 | 45 |
|
106 | | - # ------------------ RSA 1024 min size sanity check ------------------- |
107 | | - # Only check one Linux and Mac JDK version as a sanity check. Using Zulu, |
108 | | - # but this can be expanded if needed. |
109 | | - # wolfSSL ./configure: |
110 | | - # --enable-jni CFLAGS="-DRSA_MIN_SIZE=1024 |
111 | | - linux-zulu-rsa-min-size: |
112 | | - strategy: |
113 | | - matrix: |
114 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
115 | | - jdk_version: [ '11' ] |
116 | | - wolfssl_configure: [ '--enable-jni CFLAGS="-DRSA_MIN_SIZE=1024"' ] |
117 | | - name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure}}) |
118 | | - uses: ./.github/workflows/linux-common.yml |
119 | | - with: |
120 | | - os: ${{ matrix.os }} |
121 | | - jdk_distro: "zulu" |
122 | | - jdk_version: ${{ matrix.jdk_version }} |
123 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 46 | + - name: Download JUnit dependencies |
| 47 | + run: | |
| 48 | + New-Item -ItemType Directory -Force -Path "junit" |
| 49 | + Invoke-WebRequest -Uri "https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar" -OutFile "junit\junit-4.13.2.jar" |
| 50 | + Invoke-WebRequest -Uri "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar" -OutFile "junit\hamcrest-all-1.3.jar" |
| 51 | + echo "JUNIT_HOME=${{ github.workspace }}\junit" >> $env:GITHUB_ENV |
124 | 52 |
|
125 | | - # ------------------ Facebook Infer static analysis ------------------- |
126 | | - # Run Facebook infer over PR code, only running on Linux with one |
127 | | - # JDK/version for now. |
128 | | - fb-infer: |
129 | | - strategy: |
130 | | - matrix: |
131 | | - os: [ 'ubuntu-latest' ] |
132 | | - jdk_version: [ '11' ] |
133 | | - wolfssl_configure: [ '--enable-jni --enable-all' ] |
134 | | - name: Facebook Infer (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure }}) |
135 | | - uses: ./.github/workflows/infer.yml |
136 | | - with: |
137 | | - os: ${{ matrix.os }} |
138 | | - jdk_distro: "zulu" |
139 | | - jdk_version: ${{ matrix.jdk_version }} |
140 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 53 | + - name: Configure wolfSSL user_settings.h for wolfCrypt JNI |
| 54 | + run: | |
| 55 | + $userSettingsPath = "wolfssl\IDE\WIN\user_settings.h" |
| 56 | + $content = Get-Content $userSettingsPath -Raw |
| 57 | + $newDefines = @" |
| 58 | +#define WOLFSSL_KEY_GEN |
| 59 | +#define HAVE_CRL |
| 60 | +#define OPENSSL_ALL |
141 | 61 |
|
142 | | - # ----------------------- Android Gradle build ------------------------ |
143 | | - # Run Android gradle build over PR code, only running on Linux with one |
144 | | - # JDK/version for now. |
145 | | - android-gradle: |
146 | | - strategy: |
147 | | - matrix: |
148 | | - os: [ 'ubuntu-latest' ] |
149 | | - jdk_version: [ '21' ] |
150 | | - name: Android Gradle (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }}) |
151 | | - uses: ./.github/workflows/android_gradle.yml |
152 | | - with: |
153 | | - os: ${{ matrix.os }} |
154 | | - jdk_distro: "zulu" |
155 | | - jdk_version: ${{ matrix.jdk_version }} |
| 62 | +"@ |
| 63 | + $insertPoint = $content.IndexOf("/* Configuration */") |
| 64 | + if ($insertPoint -ne -1) { |
| 65 | + $newContent = $content.Insert($insertPoint, $newDefines) |
| 66 | + Set-Content -Path $userSettingsPath -Value $newContent |
| 67 | + } else { |
| 68 | + Write-Error "Could not find insertion point in user_settings.h" |
| 69 | + } |
156 | 70 |
|
157 | | - # --------------------- Maven build - test pom.xml -------------------- |
158 | | - # Run Maven build over PR code, running on Linux and Mac with only one |
159 | | - # JDK/version for now. |
160 | | - maven-build: |
161 | | - strategy: |
162 | | - matrix: |
163 | | - os: [ 'ubuntu-latest', 'macos-latest' ] |
164 | | - jdk_version: [ '21' ] |
165 | | - wolfssl_configure: [ '--enable-jni' ] |
166 | | - name: Maven Build (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }}) |
167 | | - uses: ./.github/workflows/maven.yml |
168 | | - with: |
169 | | - os: ${{ matrix.os }} |
170 | | - jdk_distro: "zulu" |
171 | | - jdk_version: ${{ matrix.jdk_version }} |
172 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 71 | + - name: Build wolfSSL DLL (x64 DLL Release) |
| 72 | + run: | |
| 73 | + cd wolfssl |
| 74 | + msbuild wolfssl64.sln -p:Configuration="DLL Release" -p:Platform=x64 |
173 | 75 |
|
174 | | - # --------------- AddressSanitizer build and test ------------------ |
175 | | - # Run AddressSanitizer build and test on Linux only for memory error detection |
176 | | - address-sanitizer: |
177 | | - strategy: |
178 | | - matrix: |
179 | | - os: [ 'ubuntu-latest' ] |
180 | | - jdk_version: [ '21' ] |
181 | | - wolfssl_configure: [ '--enable-jni' ] |
182 | | - name: AddressSanitizer (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }}) |
183 | | - uses: ./.github/workflows/sanitizer-common.yml |
184 | | - with: |
185 | | - os: ${{ matrix.os }} |
186 | | - jdk_distro: "zulu" |
187 | | - jdk_version: ${{ matrix.jdk_version }} |
188 | | - wolfssl_configure: ${{ matrix.wolfssl_configure }} |
| 76 | + - name: Build wolfCrypt JNI DLL (x64 DLL Release) |
| 77 | + run: | |
| 78 | + cd wolfcryptjni\IDE\WIN |
| 79 | + msbuild wolfcryptjni.sln -p:Configuration="DLL Release" -p:Platform=x64 |
189 | 80 |
|
| 81 | + - name: Run JUnit tests (Windows x64 Release) |
| 82 | + run: | |
| 83 | + cd wolfcryptjni |
| 84 | + ant test-win64-release |
| 85 | +
|
| 86 | + - name: Show logs on failure |
| 87 | + if: failure() || cancelled() |
| 88 | + run: | |
| 89 | + if (Test-Path "wolfcryptjni\build\reports") { |
| 90 | + Get-ChildItem "wolfcryptjni\build\reports\*.txt" | ForEach-Object { Get-Content $_.FullName } |
| 91 | + } |
0 commit comments