-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenSSL tests from the vibe.d repository #2
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Test old OpenSSL version(s) | ||
# | ||
# As we are using `ubuntu-latest`, we cannot rely on the installed | ||
# `openssl` package to test all supported versions. | ||
# Instead, this workflow installs an explicit version, builds it, | ||
# and test the tls package with it. | ||
name: OpenSSL | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
deps: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
openssl: | ||
- version: 1.0.2u | ||
link: https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz | ||
- version: 1.1.0l | ||
link: https://www.openssl.org/source/old/1.1.0/openssl-1.1.0l.tar.gz | ||
- version: 1.1.1o | ||
link: https://www.openssl.org/source/openssl-1.1.1o.tar.gz | ||
- version: 3.0.3 | ||
link: https://www.openssl.org/source/openssl-3.0.3.tar.gz | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 15 | ||
|
||
# Build the OpenSSL version if not already cached | ||
steps: | ||
- name: 'Looking up cache' | ||
id: cache-openssl | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ github.workspace }}/openssl/ | ||
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.openssl.version }} | ||
|
||
- name: 'Download and build OpenSSL ${{ matrix.openssl.version }}' | ||
if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
run: | | ||
|
||
mkdir -p ${{ github.workspace }}/openssl/ | ||
pushd ${{ github.workspace }}/openssl/ | ||
wget -O download.tar.gz ${{ matrix.openssl.link }} | ||
tar -xf download.tar.gz | ||
pushd openssl-${{ matrix.openssl.version }}/ | ||
./config --prefix=${{ github.workspace }}/openssl/install/ | ||
make install | ||
echo "OpenSSL ${{ matrix.openssl.version }} has been installed in: ${{ github.workspace }}/openssl/install/" | ||
# The previous job was separated to avoid a build once per matrix row, | ||
# as opposed to once per platform / version as we want. | ||
test: | ||
name: Run | ||
needs: deps | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
dc: | ||
- dmd-latest | ||
# - ldc-latest | ||
openssl: | ||
- version: 1.0.2u | ||
lib-dir: lib | ||
- version: 1.1.0l | ||
lib-dir: lib | ||
- version: 1.1.1o | ||
lib-dir: lib | ||
- version: 3.0.3 | ||
lib-dir: lib64 | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare compiler | ||
uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ${{ matrix.dc }} | ||
|
||
- name: 'Restore openssl from cache' | ||
id: lookup-openssl | ||
uses: actions/cache@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cache version probably need to be upgraded as well |
||
with: | ||
path: ${{ github.workspace }}/openssl/ | ||
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.openssl.version }} | ||
|
||
- name: 'Make sure OpenSSL was loaded from cache' | ||
if: steps.lookup-openssl.outputs.cache-hit != 'true' | ||
run: exit 1 | ||
|
||
- name: 'Export env variables & fetch dependencies' | ||
run: | | ||
# LD_LIBRARY_PATH affects `dub` somehow when fetching from the registry, leading to an error, | ||
# so pre-fetch dependencies. | ||
dub build :tls | ||
|
||
echo "PKG_CONFIG_PATH=${{ github.workspace }}/openssl/install/${{ matrix.openssl.lib-dir }}/pkgconfig/" >> $GITHUB_ENV | ||
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${{ github.workspace }}/openssl/install/${{ matrix.openssl.lib-dir }}/" >> $GITHUB_ENV | ||
|
||
- name: 'Run tests for vibe-stream:tls' | ||
run: | | ||
echo "pkg-config uses: $(pkg-config --modversion openssl)" | ||
if [ `pkg-config --modversion openssl` != "${{ matrix.openssl.version }}" ]; then | ||
echo "Expected version '${{ matrix.openssl.version }}' but got `pkg-config --modversion openssl`" | ||
exit 1 | ||
fi | ||
dub --skip-registry=all test :tls |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v4