Skip to content

Commit

Permalink
Ignore errors and validate installed version
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Nov 11, 2024
1 parent 88c9116 commit fb6a759
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ jobs:
- name: Uninstall openssl and conflicts
run: apk del openssl-dev openssl-libs-static libxml2-static
- name: Install ${{ matrix.pkg }}
run: apk add "${{ matrix.pkg }}" --repository=${{ matrix.repository }}
- name: Print LibSSL version
run: bin/crystal eval 'require "openssl"; p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION'
# `apk add` may exit with a failure status due to some file incompatibilities,
# but still install all the necessary parts for our purposes. So we ignore failure.
# Reason: ERROR: libressl2.7-libcrypto-2.7.5-r0: trying to overwrite etc/ssl/openssl.cnf owned by libcrypto3-3.3.2-r0.
run: apk add "${{ matrix.pkg }}" --repository=${{ matrix.repository }} || true
- name: Check LibSSL version
run: |
bin/crystal eval <<CRYSTAL
require "openssl"
p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION
restriction = "${{ matrix.pkg}}".partition("=~")[2]
version = "${{ matrix.pkg }}".starts_with?("openssl") ? LibSSL::OPENSSL_VERSION : LibSSL::LIBRESSL_VERSION
exit version.starts_with?(restriction) ? 0 : 1
CRYSTAL
- name: Run OpenSSL specs
run: bin/crystal spec --order=random spec/std/openssl/

0 comments on commit fb6a759

Please sign in to comment.