88 with :
99 engine : cruby-truffleruby
1010 min_version : 2.7
11+
1112 test :
1213 needs : ruby-versions
1314 name : >-
2223 exclude :
2324 - { os: windows-latest, ruby: truffleruby }
2425 - { os: windows-latest, ruby: truffleruby-head }
25- - { os: macos-latest, ruby: truffleruby }
26- - { os: ubuntu-20.04, ruby: truffleruby }
2726 include :
2827 - { os: windows-latest, ruby: ucrt }
2928 - { os: windows-latest, ruby: mswin }
@@ -43,26 +42,25 @@ jobs:
4342 run : echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
4443 if : runner.os == 'Linux' || runner.os == 'macOS'
4544
46- - name : set flags to check compiler warnings.
45+ - name : set flags to check compiler warnings
4746 run : echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
4847 if : ${{ !matrix.skip-warnings }}
4948
50- - name : compile
49+ - name : rake compile
5150 run : bundle exec rake compile
5251
53- - name : test
52+ - name : rake test
5453 run : bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
5554 timeout-minutes : 5
5655
5756 test-openssls :
5857 name : >-
59- ${{ matrix.openssl }} ${{ matrix.name-extra || '' }}
60- runs-on : ${{ matrix.os }}
58+ ${{ matrix.openssl }} ${{ matrix.name-extra }}
59+ runs-on : ubuntu-latest
6160 strategy :
6261 fail-fast : false
6362 matrix :
64- os : [ ubuntu-latest ]
65- ruby : [ "3.0" ]
63+ name-extra : [ '' ]
6664 openssl :
6765 # https://openssl-library.org/source/
6866 - openssl-1.0.2u # EOL
7270 - openssl-3.1.6
7371 - openssl-3.2.2
7472 - openssl-3.3.1
73+ - openssl-master
7574 # http://www.libressl.org/releases.html
7675 - libressl-3.1.5 # EOL
7776 - libressl-3.2.7 # EOL
@@ -82,94 +81,87 @@ jobs:
8281 - libressl-3.7.3 # EOL
8382 - libressl-3.8.4
8483 - libressl-3.9.2
85- fips-enabled : [ false ]
8684 include :
87- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-3.0.14, fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
88- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-3.1.6, fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
89- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-3.2.2, fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
90- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-3.3.1, fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
91- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-head, git: 'https://github.com/openssl/openssl.git', branch: 'master' }
92- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-head, git: 'https://github.com/openssl/openssl.git', branch: 'master', fips-enabled: true, append-configure: 'enable-fips', name-extra: 'fips' }
93- - { os: ubuntu-latest, ruby: "3.0", openssl: openssl-head, git: 'https://github.com/openssl/openssl.git', branch: 'master', append-configure: 'no-legacy', name-extra: 'no-legacy' }
85+ - { name-extra: 'with fips provider', openssl: openssl-3.0.14, fips-enabled: true }
86+ - { name-extra: 'with fips provider', openssl: openssl-3.1.6, fips-enabled: true }
87+ - { name-extra: 'with fips provider', openssl: openssl-3.2.2, fips-enabled: true }
88+ - { name-extra: 'with fips provider', openssl: openssl-3.3.1, fips-enabled: true }
89+ - { name-extra: 'with fips provider', openssl: openssl-master, fips-enabled: true }
90+ - { name-extra: 'without legacy provider', openssl: openssl-3.3.1, append-configure: 'no-legacy' }
9491 steps :
9592 - name : repo checkout
9693 uses : actions/checkout@v4
9794
98- - name : prepare openssl
95+ - id : cache-openssl
96+ uses : actions/cache@v4
97+ with :
98+ path : ~/openssl
99+ key : openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }}
100+ if : matrix.openssl != 'openssl-master' && matrix.openssl != 'libressl-master'
101+
102+ - name : Compile OpenSSL library
103+ if : steps.cache-openssl.outputs.cache-hit != 'true'
99104 run : |
100105 # Enable Bash debugging option temporarily for debugging use.
101106 set -x
102107 mkdir -p tmp/build-openssl && cd tmp/build-openssl
103108 case ${{ matrix.openssl }} in
104- openssl-*)
105- if [ -z "${{ matrix.git }}" ]; then
106- curl -OL https://openssl.org/source/${{ matrix.openssl }}.tar.gz
107- tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
108- else
109- git clone -b ${{ matrix.branch }} --depth 1 ${{ matrix.git }} ${{ matrix.openssl }}
110- cd ${{ matrix.openssl }}
111- # Log the commit hash.
112- echo "Git commit: $(git rev-parse HEAD)"
113- fi
109+ openssl-1.*)
110+ OPENSSL_COMMIT=$(echo ${{ matrix.openssl }} | sed -e 's/^openssl-/OpenSSL_/' | sed -e 's/\./_/g')
111+ git clone -b $OPENSSL_COMMIT --depth 1 https://github.com/openssl/openssl.git .
112+ echo "Git commit: $(git rev-parse HEAD)"
114113 # shared is required for 1.0.x.
115- ./Configure --prefix=$HOME/.openssl/${{ matrix.openssl }} --libdir=lib \
116- shared linux-x86_64 ${{ matrix.append-configure }}
117- make depend
114+ ./Configure --prefix=$HOME/openssl --libdir=lib shared linux-x86_64
115+ make depend && make -j4 && make install_sw
116+ ;;
117+ openssl-*)
118+ OPENSSL_COMMIT=${{ matrix.openssl == 'openssl-master' && 'master' || matrix.openssl }}
119+ git clone -b $OPENSSL_COMMIT --depth 1 https://github.com/openssl/openssl.git .
120+ echo "Git commit: $(git rev-parse HEAD)"
121+ ./Configure --prefix=$HOME/openssl --libdir=lib enable-fips ${{ matrix.append-configure }}
122+ make -j4 && make install_sw && make install_fips
118123 ;;
119124 libressl-*)
120- curl -OL https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${{ matrix.openssl }}.tar.gz
121- tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
122- ./configure --prefix=$HOME/.openssl/${{ matrix.openssl }}
125+ curl -L https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${{ matrix.openssl }}.tar.gz | \
126+ tar xzf - --strip-components=1
127+ ./configure --prefix=$HOME/openssl
128+ make -j4 && make install
123129 ;;
124130 *)
125131 false
126132 ;;
127133 esac
128- make -j4
129- make install_sw
130-
131- - name : prepare openssl fips
132- run : make install_fips
133- working-directory : tmp/build-openssl/${{ matrix.openssl }}
134- if : matrix.fips-enabled
135-
136- - name : set the open installed directory
137- run : >
138- sed -e "s|OPENSSL_DIR|$HOME/.openssl/${{ matrix.openssl }}|"
139- tool/openssl_fips.cnf.tmpl > tmp/openssl_fips.cnf
140- if : matrix.fips-enabled
141-
142- - name : set openssl config file path for fips.
143- run : echo "OPENSSL_CONF=$(pwd)/tmp/openssl_fips.cnf" >> $GITHUB_ENV
144- if : matrix.fips-enabled
145134
146135 - name : load ruby
147136 uses : ruby/setup-ruby@v1
148137 with :
149- ruby-version : ${{ matrix.ruby }}
150-
151- - name : depends
152- run : bundle install
138+ ruby-version : ' 3.0'
139+ bundler-cache : true
153140
154141 - name : enable mkmf verbose
155142 run : echo "MAKEFLAGS=V=1" >> $GITHUB_ENV
156- if : runner.os == 'Linux' || runner.os == 'macOS'
157143
158- - name : set flags to check compiler warnings.
144+ - name : set flags to check compiler warnings
159145 run : echo "RUBY_OPENSSL_EXTCFLAGS=-Werror" >> $GITHUB_ENV
160146 if : ${{ !matrix.skip-warnings }}
161147
162- - name : compile
163- run : rake compile -- --with-openssl-dir=$HOME/. openssl/${{ matrix.openssl }}
148+ - name : rake compile
149+ run : bundle exec rake compile -- --with-openssl-dir=$HOME/openssl
164150
165- - name : test
166- run : rake test TESTOPTS="-v --no-show-detail-immediately"
151+ - name : setup OpenSSL config file for fips
152+ run : |
153+ sed -e "s|OPENSSL_DIR|$HOME/openssl|" tool/openssl_fips.cnf.tmpl > tmp/openssl_fips.cnf
154+ echo "OPENSSL_CONF=$(pwd)/tmp/openssl_fips.cnf" >> $GITHUB_ENV
155+ if : matrix.fips-enabled
156+
157+ - name : rake test
158+ run : bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
167159 timeout-minutes : 5
168160 if : ${{ !matrix.fips-enabled }}
169161
170162 # Run only the passing tests on the FIPS module as a temporary workaround.
171163 # TODO Fix other tests, and run all the tests on FIPS module.
172- - name : test on fips module
173- run : |
174- rake test_fips TESTOPTS="-v --no-show-detail-immediately"
164+ - name : rake test_fips
165+ run : bundle exec rake test_fips TESTOPTS="-v --no-show-detail-immediately"
166+ timeout-minutes : 5
175167 if : matrix.fips-enabled
0 commit comments