Skip to content

Commit 177e98d

Browse files
Improve CI workflows: update runner versions, add timeouts, enhance OpenSSL detection (#519)
- Update runners from ubuntu-20.04 to ubuntu-latest, use modern macOS versions - Add timeout limits to prevent stuck jobs - Embed OpenSSL path discovery directly in adhoctest.yml - Update Java test matrix to include Java 25 - Change JDK distribution from temurin to zulu for better compatibility - Improve macOS OpenSSL detection with unified path logic - Add Maven cache configuration via setup-java action - Fix pom.xml test-with-jar profile configuration Co-authored-by: Cerebras Agent <193945191+isaact-cerebras@users.noreply.github.com>
1 parent 369b6ca commit 177e98d

8 files changed

Lines changed: 106 additions & 47 deletions

File tree

.github/workflows/adhoctest.yml

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ permissions:
3030

3131
jobs:
3232
build:
33+
timeout-minutes: 5
3334

3435
runs-on: ${{ matrix.os }}
3536
strategy:
36-
max-parallel: 20
37+
max-parallel: 10
3738
matrix:
38-
os: [macos-13, macos-14]
39-
# os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04]
39+
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#supported-runners-and-hardware-resources
40+
os: [macos-15-intel, macos-26-intel, macos-14, macos-15, macos-26, ubuntu-latest, windows-latest]
4041
fail-fast: false
4142

4243
steps:
@@ -47,16 +48,73 @@ jobs:
4748
run: |
4849
dir "C:\Program Files\OpenSSL*\*"
4950
dir "C:\Program Files\OpenSSL*\lib\*"
50-
- name: Find aes.h on !Windows
51+
- name: Find OpenSSL on !Windows
5152
if: ${{ runner.os != 'Windows' }}
5253
run: |
53-
set +e # want everything to run
54-
find /usr -name aes.h -ls || true
55-
find /usr -type d -name openssl -ls || true
56-
find /opt -name aes.h -ls || true
57-
find /opt -type d -name openssl -ls || true
58-
ls -l /usr/local/include /usr/local/opt/openssl/include || true # is this where macos12-13 find aes.h?
59-
ls -l /opt/local/include || true # Try this for macos-14
60-
find /usr -type l -name openssl -ls 2>/dev/null
61-
find /opt -type l -name openssl -ls 2>/dev/null
54+
set +e
55+
set -x
56+
57+
echo "=== OpenSSL Path Discovery ==="
58+
59+
if [[ "$OSTYPE" == "darwin"* ]]; then
60+
echo "--- macOS OpenSSL Detection ---"
61+
62+
MAC_OS_OPENSSL_DIRS=(
63+
"/opt/homebrew/opt/openssl@3"
64+
"/opt/homebrew/opt/openssl@1.1"
65+
"/usr/local/opt/openssl@3"
66+
"/usr/local/opt/openssl@1.1"
67+
"/opt/local"
68+
"/opt/homebrew"
69+
"/usr/local"
70+
)
71+
72+
MAC_LIB_OPENSSL=""
73+
MAC_INC_OPENSSL=""
74+
75+
echo "--- Checking directories ---"
76+
for dir in "${MAC_OS_OPENSSL_DIRS[@]}"; do
77+
lib_dir="$dir/lib"
78+
inc_dir="$dir/include"
79+
80+
echo " Checking: $dir"
81+
82+
if [[ -d "$lib_dir" ]] && [[ -z "$MAC_LIB_OPENSSL" ]]; then
83+
for lib in "libcrypto.dylib" "libcrypto.3.dylib" "libcrypto.1.1.dylib"; do
84+
if [[ -f "$lib_dir/$lib" ]]; then
85+
MAC_LIB_OPENSSL="$lib_dir"
86+
echo " Found lib: $lib_dir/$lib"
87+
break
88+
fi
89+
done
90+
fi
91+
92+
if [[ -d "$inc_dir" ]] && [[ -z "$MAC_INC_OPENSSL" ]] && [[ -f "$inc_dir/openssl/aes.h" ]]; then
93+
MAC_INC_OPENSSL="$inc_dir"
94+
echo " Found include: $inc_dir/openssl/aes.h"
95+
fi
96+
done
97+
98+
echo "--- Discovery Results ---"
99+
if [[ -n "$MAC_LIB_OPENSSL" ]]; then
100+
echo "MAC_LIB_OPENSSL=$MAC_LIB_OPENSSL"
101+
ls -la "$MAC_LIB_OPENSSL"/libcrypto*.dylib 2>/dev/null || true
102+
else
103+
echo "MAC_LIB_OPENSSL=NOT_FOUND"
104+
fi
105+
106+
if [[ -n "$MAC_INC_OPENSSL" ]]; then
107+
echo "MAC_INC_OPENSSL=$MAC_INC_OPENSSL"
108+
ls -la "$MAC_INC_OPENSSL"/openssl/aes.h 2>/dev/null || true
109+
else
110+
echo "MAC_INC_OPENSSL=NOT_FOUND"
111+
fi
112+
else
113+
echo "--- Linux OpenSSL Detection ---"
114+
find /usr -name aes.h -ls 2>/dev/null || true
115+
find /usr -type d -name openssl -ls 2>/dev/null || true
116+
find /usr/lib* -name libcrypto.so* -ls 2>/dev/null || true
117+
fi
118+
119+
echo "=== OpenSSL Binary Locations ==="
62120
which -a openssl | while read a ;do echo "$a" ; "$a" version -a; echo '======='; done

.github/workflows/benchmarkadhoc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ permissions:
2424

2525
jobs:
2626
build:
27+
timeout-minutes: 5
2728

2829
runs-on: ${{ matrix.os }}
2930
continue-on-error: ${{ matrix.experimental }}
3031
strategy:
3132
max-parallel: 20
3233
matrix:
33-
# macos-latest and ubuntu-latest uses OpenSSL 3 which breaks tests
34-
os: [macos-11, ubuntu-20.04, windows-latest]
34+
os: [macos-15, ubuntu-latest, windows-latest]
3535
# Run lowest and highest Java versions only
36-
java: [ 8, 21 ]
36+
java: [ 8, 21, 25 ]
3737
experimental: [false]
3838
fail-fast: false
3939

@@ -50,7 +50,7 @@ jobs:
5050
- name: Set up JDK ${{ matrix.java }}
5151
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
5252
with:
53-
distribution: 'temurin'
53+
distribution: 'zulu'
5454
java-version: ${{ matrix.java }}
5555
- name: OpenSSL version
5656
run: openssl version -a

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ permissions:
3838
jobs:
3939
analyze:
4040
name: Analyze
41-
runs-on: ubuntu-20.04
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 10
4243
permissions:
4344
actions: read
4445
contents: read
4546
security-events: write
4647

4748
strategy:
48-
max-parallel: 20
49+
max-parallel: 5
4950
fail-fast: false
5051
matrix:
5152
language: [ 'cpp', 'java' ]
@@ -72,7 +73,7 @@ jobs:
7273
if: ${{ matrix.language == 'java' }}
7374
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
7475
with:
75-
distribution: 'temurin'
76+
distribution: 'zulu'
7677
java-version: ${{ matrix.java }}
7778

7879
# Initializes the CodeQL tools for scanning.

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ permissions:
2424
jobs:
2525
dependency-review:
2626
runs-on: ubuntu-latest
27+
timeout-minutes: 5
2728
steps:
2829
- name: 'Checkout Repository'
2930
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/docker_images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ permissions:
3434
jobs:
3535
docker:
3636
runs-on: ubuntu-latest
37+
timeout-minutes: 20
3738
permissions:
3839
contents: read
3940
packages: write

.github/workflows/maven_crosstest.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
build-cross-linux:
7171
needs: cleanup
7272
runs-on: ubuntu-latest
73+
timeout-minutes: 10
7374
steps:
7475
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7576
with:
@@ -94,26 +95,22 @@ jobs:
9495
# Use macOS to build its native binaries and package them with the Linux/Windows ones
9596
package-macos:
9697
needs: build-cross-linux
97-
runs-on: macos-13 # macos-14 does not have Java 8
98+
runs-on: macos-15
99+
timeout-minutes: 10
98100
steps:
99101
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
100102
with:
101103
persist-credentials: false
102104
- name: Set up JDK
103105
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
104106
with:
105-
distribution: 'temurin'
106-
java-version: 8
107+
distribution: 'zulu'
108+
java-version: 11
109+
cache: 'maven'
107110
# these values cause the plugin to set up the Maven settings.xml file
108111
server-id: apache.snapshots.https # Value of the distributionManagement/repository/id field of the pom.xml
109112
server-username: NEXUS_USER # env variable for username in deploy
110113
server-password: NEXUS_PW # env variable for token in deploy
111-
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3
112-
with:
113-
path: ~/.m2/repository
114-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
115-
restore-keys: |
116-
${{ runner.os }}-maven-
117114
- name: Build on macOS
118115
run: |
119116
mvn -V -B -ntp test -DskipTests
@@ -157,19 +154,23 @@ jobs:
157154
standalone:
158155
needs: package-macos
159156
runs-on: ${{ matrix.os }}
157+
timeout-minutes: 10
160158
# continue-on-error: ${{ matrix.experimental }}
161159
strategy:
162-
max-parallel: 20
160+
max-parallel: 20
163161
matrix:
164162
include:
165-
- os: macos-13 # macos-14 does not have Java 8
166-
java: 8
163+
- os: macos-15-intel
164+
java: 11
167165
expectedPath: Mac/x86_64
166+
- os: macos-15
167+
java: 11
168+
expectedPath: Mac/aarch64
168169
- os: ubuntu-latest
169-
java: 8
170+
java: 11
170171
expectedPath: Linux/x86_64
171172
- os: windows-latest
172-
java: 8
173+
java: 11
173174
expectedPath: Windows/x86_64
174175
steps:
175176
- name: Checkout code
@@ -185,18 +186,12 @@ jobs:
185186
fail-on-cache-miss: true
186187
- name: Show files
187188
run: ls -l target
188-
- name: Cache Maven
189-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3
190-
with:
191-
path: ~/.m2/repository
192-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
193-
restore-keys: |
194-
${{ runner.os }}-maven-
195189
- name: Set up JDK ${{ matrix.java }}
196190
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
197191
with:
198-
distribution: 'temurin'
192+
distribution: 'zulu'
199193
java-version: ${{ matrix.java }}
194+
cache: 'maven'
200195
- name: OpenSSL version (default)
201196
run: openssl version -a
202197
- name: OpenSSL engine (macOS)
@@ -214,6 +209,7 @@ jobs:
214209
test-cross-linux:
215210
needs: package-macos
216211
runs-on: ubuntu-latest
212+
timeout-minutes: 10
217213
steps:
218214
- name: Checkout
219215
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -234,7 +230,7 @@ jobs:
234230
IMAGE_PREFIX=${IMAGE_PREFIX} docker compose -f src/docker/docker-compose-gh.yaml run --quiet-pull crypto-aarch64-gh \
235231
src/docker/test_cross.sh -Ptest-with-jar -DOsInfoTest.expectedPath=Linux/aarch64
236232
- name: Run on riscv64
237-
# See https://github.com/java-native-access/jna/issues/1557
233+
# locked to 5.12.0 - see https://github.com/java-native-access/jna/issues/1557
238234
run: |
239235
IMAGE_PREFIX=${IMAGE_PREFIX} docker compose -f src/docker/docker-compose-gh.yaml run --quiet-pull crypto-riscv64-gh \
240236
src/docker/test_cross.sh -Ptest-with-jar -DOsInfoTest.expectedPath=Linux/riscv64 -Djna.version=5.12.0

.github/workflows/scorecards-analysis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
analysis:
3333

3434
name: "Scorecards analysis"
35-
runs-on: ubuntu-20.04
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 5
3637
permissions:
3738
# Needed to upload the results to the code-scanning dashboard.
3839
security-events: write

pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The following provides more details on the included cryptographic software:
8181
Running examples (these are under the test tree, so need test scope):
8282
mvn -q -Dexec.classpathScope=test -Dexec.mainClass=org.apache.commons.crypto.examples.CLASSNAME
8383
where CLASSNAME is CipherByteArrayExample, CipherByteBufferExample, RandomExample, StreamExample
84-
84+
8585
Additional options
8686
-Djna.debug_load - debug JNA loading
8787
-Dcommons.crypto.debug - add some Commons Crypto debugging
@@ -318,11 +318,12 @@ The following provides more details on the included cryptographic software:
318318
<artifactId>maven-surefire-plugin</artifactId>
319319
<configuration>
320320
<classesDirectory>/dev/null</classesDirectory>
321+
<testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory>
321322
<additionalClasspathElements>${project.build.directory}/${project.artifactId}-${project.version}.jar</additionalClasspathElements>
322323
</configuration>
323324
</plugin>
324325
</plugins>
325-
</build>
326+
</build>
326327
</profile>
327328
</profiles>
328329
<build>
@@ -623,7 +624,7 @@ The following provides more details on the included cryptographic software:
623624
</dependency>
624625
<dependency>
625626
<groupId>org.junit.jupiter</groupId>
626-
<artifactId>junit-jupiter</artifactId>
627+
<artifactId>junit-jupiter-api</artifactId>
627628
<scope>test</scope>
628629
</dependency>
629630
<dependency>

0 commit comments

Comments
 (0)