This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-crypto.git
The following commit(s) were added to refs/heads/master by this push: new 92e496ba Simplify os checks 92e496ba is described below commit 92e496ba210324683a015b5b1fee8f9fd039dbeb Author: Sebb <s...@apache.org> AuthorDate: Sat Nov 18 11:13:51 2023 +0000 Simplify os checks --- .github/workflows/maven.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2accc3bb..0ed032ba 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -93,16 +93,15 @@ jobs: run: openssl version -a - name: OpenSSL engine (macos) # need to override the libarary path on macOS to avoid 'unsafe load' complaint - if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} + if: ${{ startsWith('macos',matrix.os) }} run: | echo $(openssl version -e | sed -n -e 's/engines-.*//' -e 's/: "/=/p') >> "$GITHUB_ENV" - name: OpenSSL engine (windows) # need to override the library name on windows else it uses the default LibreSSL - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ startsWith('windows',matrix.os) }} # e.g. NAME: "libcrypto-1_1-x64.dll" # Not sure how to derive this automatically run: | - openssl version -a echo "NAME=libcrypto-1_1-x64.dll" >> $env:GITHUB_ENV # N.B. '-V -B -ntp' is shorthand for '--show-version --batch-mode --no-transfer-progress' # @@ -113,7 +112,7 @@ jobs: # Instead of defining jni.library.path and jna.library.path we need to define # jni.library.name and commons.crypto.OpenSslNativeJna to override the file names - name: Build with Maven (Windows) - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ startsWith('windows',matrix.os) }} # OPENSSL_HOME is needed for Windows build to find some header files # It's not clear how one is supposed to find the correct setting; # The value below was found by searching for openssl files under C (warning: slow) @@ -126,9 +125,9 @@ jobs: run: | mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.name=$env:NAME" -D"commons.crypto.OpenSslNativeJna=$env:NAME" - name: Build with Maven (not Windows) - if: ${{ matrix.os != 'windows-latest' }} + if: ${{ ! startsWith('windows',matrix.os) }} run: | - mvn -V -B -ntp -DtrimStackTrace=false -D"jni.library.path=$ENGINESDIR" -D"jna.library.path=$ENGINESDIR" + mvn -V -B -ntp -DtrimStackTrace=false -Djni.library.path=$ENGINESDIR -Djna.library.path=$ENGINESDIR - name: Check benchmark code compiles if: ${{ matrix.java == '8' }} env: @@ -138,7 +137,8 @@ jobs: - name: Check JNI and JNA tests are independent # N.B. the default library fails with 'java is loading libcrypto in an unsafe way' # so we need to define the appropriate library for each test - if: ${{ matrix.java == '8' && matrix.os != 'windows-latest' }} + # No need to test on all OS/Java combinations + if: ${{ matrix.java == '8' && startsWith('ubuntu',matrix.os) }} run: | mvn -V -B -ntp test -Ptestjni -D"jni.library.path=$ENGINESDIR" -Dcommons.crypto.OpenSslNativeJna=___ mvn -V -B -ntp test -Ptestjna -D"jna.library.path=$ENGINESDIR" -Djni.library.name=___