@@ -97,13 +97,78 @@ jobs:
9797
9898 timeout-minutes : 60
9999
100+ rubygems-openssl :
101+ name : RubyGems with AWS-LC
102+ runs-on : ubuntu-24.04
103+
104+ steps :
105+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
106+ with :
107+ persist-credentials : false
108+
109+ # Keep the AWS-LC build and cache behavior aligned with ruby/openssl.
110+ # https://github.com/ruby/openssl/blob/master/.github/workflows/test.yml
111+ # Caches that are accessed at least once a week can remain permanently.
112+ # Include the current week in the key so the latest AWS-LC is built weekly.
113+ # https://github.com/actions/cache#cache-limits
114+ - name : Get current week
115+ id : current-week
116+ run : echo "week=$(date -u '+%Y%W')" >> "$GITHUB_OUTPUT"
117+
118+ - name : Restore AWS-LC cache
119+ id : cache-aws-lc
120+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
121+ with :
122+ path : ~/openssl
123+ key : aws-lc-${{ runner.os }}-${{ runner.arch }}-${{ steps.current-week.outputs.week }}
124+
125+ - name : Compile AWS-LC
126+ if : steps.cache-aws-lc.outputs.cache-hit != 'true'
127+ run : |
128+ mkdir -p tmp/build-aws-lc
129+ cd tmp/build-aws-lc
130+ git clone https://github.com/aws/aws-lc.git .
131+ AWS_LC_RELEASE=$(git tag --sort=-creatordate --list "v*" | head -1)
132+ git checkout "$AWS_LC_RELEASE"
133+ cmake -DCMAKE_INSTALL_PREFIX="$HOME/openssl" -DCMAKE_INSTALL_LIBDIR=lib
134+ make -j4
135+ make install
136+
137+ - name : Setup ruby
138+ uses : ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
139+ with :
140+ ruby-version : 4.0.5
141+ bundler : none
142+
143+ - name : Install Ruby OpenSSL against AWS-LC
144+ run : |
145+ gem install openssl --no-document -- --with-openssl-dir="$HOME/openssl"
146+ ruby -e 'spec = Gem::Specification.find_by_name("openssl"); puts "RUBYLIB=#{spec.full_require_paths.join(File::PATH_SEPARATOR)}"' >> "$GITHUB_ENV"
147+
148+ - name : Verify AWS-LC
149+ run : |
150+ ruby --disable-gems -ropenssl -e '
151+ abort "Ruby OpenSSL did not load AWS-LC" unless OpenSSL::OPENSSL_VERSION.include?("AWS-LC")
152+ OpenSSL::PKey.read(File.binread("test/rubygems/mldsa65_private_key.pem"))
153+ puts "Ruby OpenSSL #{OpenSSL::VERSION}: #{OpenSSL::OPENSSL_VERSION}"
154+ '
155+
156+ - name : Install Dependencies
157+ run : bin/rake setup
158+
159+ - name : Run Test
160+ run : bin/rake test
161+
162+ timeout-minutes : 60
163+
100164 all-pass :
101165 name : All rubygems jobs pass
102166
103167 if : always()
104168
105169 needs :
106170 - rubygems
171+ - rubygems-openssl
107172
108173 runs-on : ubuntu-latest
109174
0 commit comments