@@ -3,7 +3,13 @@ name: CI
33on : [push, pull_request]
44
55jobs :
6+ ruby-versions :
7+ uses : ruby/actions/.github/workflows/ruby_versions.yml@master
8+ with :
9+ engine : cruby-truffleruby
10+ min_version : 2.6
611 test :
12+ needs : ruby-versions
713 name : >-
814 ${{ matrix.os }} ${{ matrix.ruby }}
915 runs-on : ${{ matrix.os }}
@@ -12,17 +18,21 @@ jobs:
1218 matrix :
1319 # ubuntu-22.04 uses OpenSSL 3.0, ubuntu-20.04 uses OpenSSL 1.1.1
1420 os : [ ubuntu-22.04, ubuntu-20.04, macos-latest, windows-latest ]
15- ruby : [ head, "3.1", "3.0", "2.7", "2.6" ]
21+ ruby : ${{ fromJson(needs.ruby-versions.outputs.versions) }}
1622 exclude :
1723 # uses non-standard MSYS2 OpenSSL 3 package
1824 - { os: windows-latest, ruby: head }
25+ - { os: windows-latest, ruby: truffleruby }
26+ - { os: windows-latest, ruby: truffleruby-head }
27+ - { os: macos-latest, ruby: truffleruby }
28+ - { os: ubuntu-20.04, ruby: truffleruby }
1929 include :
2030 - { os: windows-latest, ruby: ucrt }
2131 - { os: windows-latest, ruby: mswin }
2232
2333 steps :
2434 - name : repo checkout
25- uses : actions/checkout@v3
35+ uses : actions/checkout@v4
2636
2737 - name : load ruby
2838 uses : ruby/setup-ruby@v1
@@ -32,48 +42,73 @@ jobs:
3242 - name : depends
3343 run : bundle install
3444
45+ # Enable the verbose option in mkmf.rb to print the compiling commands.
46+ - name : enable mkmf verbose
47+ run : echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
48+ if : runner.os == 'Linux' || runner.os == 'macOS'
49+
50+ - name : set flags to check compiler warnings.
51+ run : echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
52+ if : ${{ !matrix.skip-warnings }}
53+
3554 - name : compile
36- run : rake compile -- --enable-debug
55+ run : rake compile
3756
3857 - name : test
39- run : rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
58+ run : rake test TESTOPTS="-v --no-show-detail-immediately"
4059 timeout-minutes : 5
4160
4261 test-openssls :
4362 name : >-
44- ${{ matrix.openssl }}
63+ ${{ matrix.openssl }} ${{ matrix.name-extra || '' }}
4564 runs-on : ${{ matrix.os }}
4665 strategy :
4766 fail-fast : false
4867 matrix :
4968 os : [ ubuntu-latest ]
5069 ruby : [ "3.0" ]
5170 openssl :
71+ # https://www.openssl.org/source/
5272 - openssl-1.0.2u # EOL
5373 - openssl-1.1.0l # EOL
54- - openssl-1.1.1s
55- - openssl-3.0.7
74+ - openssl-1.1.1w # EOL
75+ - openssl-3.0.13
76+ - openssl-3.1.5
77+ - openssl-3.2.1
78+ - openssl-3.3.0
79+ # http://www.libressl.org/releases.html
5680 - libressl-3.1.5 # EOL
5781 - libressl-3.2.7 # EOL
5882 - libressl-3.3.6 # EOL
5983 - libressl-3.4.3 # EOL
60- - libressl-3.5.3
61- - libressl-3.6.1
62- - libressl-3.7.0 # Development release
84+ - libressl-3.5.3 # EOL
85+ - libressl-3.6.3 # EOL
86+ - libressl-3.7.3 # EOL
87+ - libressl-3.8.4
88+ - libressl-3.9.1
6389 steps :
6490 - name : repo checkout
65- uses : actions/checkout@v3
91+ uses : actions/checkout@v4
6692
6793 - name : prepare openssl
6894 run : |
95+ # Enable Bash debugging option temporarily for debugging use.
96+ set -x
6997 mkdir -p tmp/build-openssl && cd tmp/build-openssl
7098 case ${{ matrix.openssl }} in
7199 openssl-*)
72- curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
73- tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
100+ if [ -z "${{ matrix.git }}" ]; then
101+ curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
102+ tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
103+ else
104+ git clone -b ${{ matrix.branch }} --depth 1 ${{ matrix.git }} ${{ matrix.openssl }}
105+ cd ${{ matrix.openssl }}
106+ # Log the commit hash.
107+ echo "Git commit: $(git rev-parse HEAD)"
108+ fi
74109 # shared is required for 1.0.x.
75110 ./Configure --prefix=$HOME/.openssl/${{ matrix.openssl }} --libdir=lib \
76- shared linux-x86_64
111+ shared linux-x86_64 ${{ matrix.append-configure }}
77112 make depend
78113 ;;
79114 libressl-*)
@@ -96,9 +131,17 @@ jobs:
96131 - name : depends
97132 run : bundle install
98133
134+ - name : enable mkmf verbose
135+ run : echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
136+ if : runner.os == 'Linux' || runner.os == 'macOS'
137+
138+ - name : set flags to check compiler warnings.
139+ run : echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
140+ if : ${{ !matrix.skip-warnings }}
141+
99142 - name : compile
100- run : rake compile -- --enable-debug -- with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}
143+ run : rake compile -- --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}
101144
102145 - name : test
103- run : rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1
146+ run : rake test TESTOPTS="-v --no-show-detail-immediately"
104147 timeout-minutes : 5
0 commit comments