Skip to content

Commit

Permalink
.github/workflows/test.yml: synchronize with master
Browse files Browse the repository at this point in the history
[ This is a backport to the 3.0 branch. ]

Backport changes made to .github/workflows/test.yml in master branch,
except:

 - Minimum version is Ruby 2.6
 - FIPS-mode related changes are excluded (as it's not supported)

This includes the following commits:

	fcf53d5 CI: Remove workaround for Ruby-3.2 and 3.3 on Windows
	567b412 CI: Upgrade OpenSSL and LibreSSL versions.
	405f1ee CI: Add OpenSSL no-legacy case.
	9a99583 CI: Upgrade OpenSSL and LibreSSL versions.
	6feeeb8 CI: Add the rubyinstaller2 issue link that legacy provider is not loaded.
	7aed35a Windows Ruby 3.3: Workaround: Set OPENSSL_MODULES to find providers.
	adfb6bb CI: Add OpenSSL 3.2.0.
	fafe1af CI: Change the openssl_fips.cnf.tmpl and openssl_fips.cnf directories.
	f07e6f5 CI: Upgrade OpenSSL and LibreSSL versions.
	0dda88d Merge pull request ruby#682 from ruby/dependabot/github_actions/actions/checkout-4
	0b83eed Rakefile: Add test_fips task for convenience.
	b94314f Bump actions/checkout from 3 to 4
	8c7a6a1 Remove OSSL_DEBUG compile-time option
	e35f190 CI: Replace "mode" in "FIPS mode" with "module".
	61434f6 Rakefile: Print FIPS information in the `rake debug`.
	7ec8024 CI: Add OpenSSL master branch head non-FIPS and FIPS cases.
	24d8add CI: Upgrade OpenSSL versions.
	fddfc55 CI: Add OpenSSL 3.1 FIPS case.
	58ce7fa .github/workflows/test.yml: add provider load path for Windows
	f6e57e1 CI: Fix a typo in the comment. [ci skip]
	52402f6 CI: Check compiler warnings.
	f6ba75e Drop support for Ruby 2.6
	3456770 CI: Upgrade OpenSSL and LibreSSL versions.
	79786ca CI: Rename the key name "foo_bar" (underscore) to "foo-bar" (hyphen).
	8149cdf CI: Add the test/openssl/test_pkey.rb on the FIPS mode case.
	08e1981 CI: Enable the verbose mode in the mkmf.rb by env MAKEFLAGS.
	121b3b2 Revert "CI: Enable the verbose mode in the mkmf.rb."
	a832f5c CI: Enable the verbose mode in the mkmf.rb.
	18b0172 CI: Add OpenSSL FIPS mode case.
	af27f50 .github/workflows/test.yml: Update OpenSSL versions
	d277123 skip failing test with truffleruby and ubuntu-22.04
	25352f4 Exclude truffleruby with macos-latest
	d7f90c7 Fix missing needs call
	0640664 Try to run with TruffleRuby
	aeee125 Use ruby/actions/.github/workflows/ruby_versions.yml@master
	fd40742 .github/workflows/test.yml: update LibreSSL versions
	ff2fe4b Strip trailing spaces [ci skip]
	9c24dcc Actions - Use Ubuntu 20.04 for 1.1.1 CI, misc fixes
	cc876f5 [CI] test.yml - test-openssls - use 1.1.1q, 3.0.5
	0fb8d1b [CI] add Ubuntu-22.04 and update mswin, all are OpenSSL 3
	1588686 Merge pull request ruby#505 from ruby/update-actions
	9f901dc Test on LibreSSL 3.4 and 3.5
	f2d072c Use actions/checkout@v3
	699e274 Added 3.1
	b28df90 Install openssl with vcpkg on mswin
  • Loading branch information
rhenium committed Apr 30, 2024
1 parent cf229f5 commit ee9e162
Showing 1 changed file with 71 additions and 47 deletions.
118 changes: 71 additions & 47 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,36 @@ name: CI
on: [push, pull_request]

jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby-truffleruby
min_version: 2.6
test:
needs: ruby-versions
name: >-
${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# ubuntu-latest is 22.04, uses OpenSSL 3
os: [ ubuntu-20.04, macos-latest ]
ruby: [ head, "3.0", "2.7", "2.6" ]
# ubuntu-22.04 uses OpenSSL 3.0, ubuntu-20.04 uses OpenSSL 1.1.1
os: [ ubuntu-22.04, ubuntu-20.04, macos-latest, windows-latest ]
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
exclude:
# uses non-standard MSYS2 OpenSSL 3 package
- { os: windows-latest, ruby: head }
- { os: windows-latest, ruby: truffleruby }
- { os: windows-latest, ruby: truffleruby-head }
- { os: macos-latest, ruby: truffleruby }
- { os: ubuntu-20.04, ruby: truffleruby }
include:
- { os: windows-latest, ruby: ucrt }
- { os: windows-latest, ruby: mswin }

steps:
- name: repo checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: load ruby
uses: ruby/setup-ruby@v1
Expand All @@ -25,75 +42,73 @@ jobs:
- name: depends
run: bundle install

- name: compile
run: rake compile -- --enable-debug
# Enable the verbose option in mkmf.rb to print the compiling commands.
- name: enable mkmf verbose
run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: test
run: rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
- name: set flags to check compiler warnings.
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
if: ${{ !matrix.skip-warnings }}

test-windows:
name: >-
${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
# current mswin build uses OpenSSL 3
ruby: [ mingw, "3.0", "2.7", "2.6" ]
steps:
- name: repo checkout
uses: actions/checkout@v3

- name: load ruby, install/update gcc, install openssl
uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
mingw: _upgrade_ openssl

- name: depends
run: bundle install

# pkg-config is disabled because it can pick up the different OpenSSL installation
# SSL_DIR is set as needed by MSP-Greg/setup-ruby-pkgs
# only used with mswin
- name: compile
run: rake compile -- --enable-debug --without-pkg-config $env:SSL_DIR
run: rake compile

- name: test
run: rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
run: rake test TESTOPTS="-v --no-show-detail-immediately"
timeout-minutes: 5

test-openssls:
name: >-
${{ matrix.openssl }}
${{ matrix.openssl }} ${{ matrix.name-extra || '' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
ruby: [ "3.0" ]
openssl:
# https://www.openssl.org/source/
- openssl-1.0.2u # EOL
- openssl-1.1.0l # EOL
- openssl-1.1.1l
- openssl-3.0.1
- openssl-1.1.1w # EOL
- openssl-3.0.13
- openssl-3.1.5
- openssl-3.2.1
- openssl-3.3.0
# http://www.libressl.org/releases.html
- libressl-3.1.5 # EOL
- libressl-3.2.6
- libressl-3.3.4
- libressl-3.2.7 # EOL
- libressl-3.3.6 # EOL
- libressl-3.4.3 # EOL
- libressl-3.5.3 # EOL
- libressl-3.6.3 # EOL
- libressl-3.7.3 # EOL
- libressl-3.8.4
- libressl-3.9.1
steps:
- name: repo checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: prepare openssl
run: |
# Enable Bash debugging option temporarily for debugging use.
set -x
mkdir -p tmp/build-openssl && cd tmp/build-openssl
case ${{ matrix.openssl }} in
openssl-*)
curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
if [ -z "${{ matrix.git }}" ]; then
curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
else
git clone -b ${{ matrix.branch }} --depth 1 ${{ matrix.git }} ${{ matrix.openssl }}
cd ${{ matrix.openssl }}
# Log the commit hash.
echo "Git commit: $(git rev-parse HEAD)"
fi
# shared is required for 1.0.x.
./Configure --prefix=$HOME/.openssl/${{ matrix.openssl }} --libdir=lib \
shared linux-x86_64
shared linux-x86_64 ${{ matrix.append-configure }}
make depend
;;
libressl-*)
Expand All @@ -116,8 +131,17 @@ jobs:
- name: depends
run: bundle install

- name: enable mkmf verbose
run: echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: set flags to check compiler warnings.
run: echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
if: ${{ !matrix.skip-warnings }}

- name: compile
run: rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}
run: rake compile -- --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}

- name: test
run: rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
run: rake test TESTOPTS="-v --no-show-detail-immediately"
timeout-minutes: 5

0 comments on commit ee9e162

Please sign in to comment.