-
-
Notifications
You must be signed in to change notification settings - Fork 66
Test against different OpenSSL library versions #464
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
732e20c
ci: manually install OpenSSL 1.1.1w
santiagorodriguez96 59d5dc8
ci: cache even when job fails
santiagorodriguez96 202a576
ci: avoid harcoding openssl-1.1.1w in install-ruby action
santiagorodriguez96 df65099
ci: run against multiple openssl versions
santiagorodriguez96 4701733
ci: avoid running Ruby 3.0 or older against openssl 3
santiagorodriguez96 ac812d3
ci: add name to test job
santiagorodriguez96 380e0d4
ci: improve readability of ruby cache key
santiagorodriguez96 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 hidden or 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,55 @@ | ||
| name: Install OpenSSL | ||
|
|
||
| inputs: | ||
| version: | ||
| description: 'The version of OpenSSL to install' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Restore cached OpenSSL library | ||
| id: cache-openssl-restore | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ~/openssl | ||
| key: openssl-${{ inputs.version }} | ||
|
|
||
| - name: Compile OpenSSL library | ||
| if: steps.cache-openssl-restore.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: | | ||
| mkdir -p tmp/build-openssl && cd tmp/build-openssl | ||
| case ${{ inputs.version }} in | ||
| 1.1.*) | ||
| OPENSSL_COMMIT=OpenSSL_ | ||
| OPENSSL_COMMIT+=$(echo ${{ inputs.version }} | sed -e 's/\./_/g') | ||
| git clone -b $OPENSSL_COMMIT --depth 1 https://github.com/openssl/openssl.git . | ||
| echo "Git commit: $(git rev-parse HEAD)" | ||
| ./Configure --prefix=$HOME/openssl --libdir=lib linux-x86_64 | ||
| make depend && make -j4 && make install_sw | ||
| ;; | ||
| 3.*) | ||
| OPENSSL_COMMIT=openssl- | ||
| OPENSSL_COMMIT+=$(echo ${{ inputs.version }}) | ||
| git clone -b $OPENSSL_COMMIT --depth 1 https://github.com/openssl/openssl.git . | ||
| echo "Git commit: $(git rev-parse HEAD)" | ||
| if [[ ${{ inputs.version }} == 3.5* ]]; then | ||
| ./Configure --prefix=$HOME/openssl --libdir=lib enable-fips no-tests no-legacy | ||
| else | ||
| ./Configure --prefix=$HOME/openssl --libdir=lib enable-fips no-tests | ||
| fi | ||
| make -j4 && make install_sw && make install_fips | ||
| ;; | ||
| *) | ||
| echo "Don't know how to build OpenSSL ${{ inputs.version }}" | ||
| ;; | ||
| esac | ||
|
|
||
| - name: Save OpenSSL library cache | ||
| if: steps.cache-openssl-restore.outputs.cache-hit != 'true' | ||
| id: cache-openssl-save | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: ~/openssl | ||
| key: ${{ steps.cache-openssl-restore.outputs.cache-primary-key }} |
This file contains hidden or 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,84 @@ | ||
| name: Install Ruby | ||
|
|
||
| inputs: | ||
| version: | ||
| description: 'The version of Ruby to install' | ||
| required: true | ||
| openssl-version: | ||
| description: 'The version of OpenSSL used' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Restore cached Ruby installation | ||
| id: cache-ruby-restore | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ~/rubies/ruby-${{ inputs.version }} | ||
| key: ruby-${{ inputs.version }}-${{ inputs.openssl-version }} | ||
|
|
||
| - name: Install Ruby | ||
| if: steps.cache-ruby-restore.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: | | ||
| latest_patch=$(curl -s https://cache.ruby-lang.org/pub/ruby/${{ inputs.version }}/ \ | ||
| | grep -oP "ruby-${{ inputs.version }}\.\d+\.tar\.xz" \ | ||
| | grep -oP "\d+(?=\.tar\.xz)" \ | ||
| | sort -V | tail -n 1) | ||
| wget https://cache.ruby-lang.org/pub/ruby/${{ inputs.version }}/ruby-${{ inputs.version }}.${latest_patch}.tar.xz | ||
| tar -xJvf ruby-${{ inputs.version }}.${latest_patch}.tar.xz | ||
| cd ruby-${{ inputs.version }}.${latest_patch} | ||
| ./configure --prefix=$HOME/rubies/ruby-${{ inputs.version }} --with-openssl-dir=$HOME/openssl | ||
| make | ||
| make install | ||
|
|
||
| - name: Update PATH | ||
| shell: bash | ||
| run: | | ||
| echo "~/rubies/ruby-${{ inputs.version }}/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Install Bundler | ||
| shell: bash | ||
| run: | | ||
| case ${{ inputs.version }} in | ||
| 2.7* | 3.*) | ||
| echo "Skipping Bundler installation for Ruby ${{ inputs.version }}" | ||
| ;; | ||
| 2.5* | 2.6*) | ||
| gem install bundler -v '~> 2.3.0' | ||
| ;; | ||
| *) | ||
| echo "Don't know how to install Bundler for Ruby ${{ inputs.version }}" | ||
| ;; | ||
| esac | ||
|
|
||
| - name: Save Ruby installation cache | ||
| if: steps.cache-ruby-restore.outputs.cache-hit != 'true' | ||
| id: cache-ruby-save | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: ~/rubies/ruby-${{ inputs.version }} | ||
| key: ${{ steps.cache-ruby-restore.outputs.cache-primary-key }} | ||
|
|
||
| - name: Cache Bundler Install | ||
| id: cache-bundler-restore | ||
| uses: actions/cache/restore@v4 | ||
| env: | ||
| GEMFILE: ${{ env.BUNDLE_GEMFILE || 'Gemfile' }} | ||
| with: | ||
| path: ~/bundler/cache | ||
| key: bundler-ruby-${{ inputs.version }}-${{ inputs.openssl-version }}-${{ hashFiles(env.Gemfile, 'webauthn.gemspec') }} | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| bundle config set --local path ~/bundler/cache | ||
| bundle install | ||
|
|
||
| - name: Save Bundler Install cache | ||
| id: cache-bundler-save | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: ~/bundler/cache | ||
| key: ${{ steps.cache-bundler-restore.outputs.cache-primary-key }} | ||
This file contains hidden or 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
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.