Skip to content

Commit 0f56450

Browse files
committed
ci: add ruby version to vendored libs cache key (#3028)
**What problem is this PR intended to solve?** In CI, add ruby version to vendored libs cache key. The ruby 2.7 and 3.0 base images are old enough to generate binaries that are not compatible with later base images, and vice versa. CI is failing with libxml 2.12.0 in particular.
1 parent 32b2c35 commit 0f56450

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
if: matrix.sys == 'disable'
9898
with:
9999
path: ports
100-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
100+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
101101
- run: bundle install --local || bundle install
102102
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
103103
- run: bundle exec rake test
@@ -128,7 +128,7 @@ jobs:
128128
if: matrix.sys == 'disable'
129129
with:
130130
path: ports
131-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
131+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
132132
- run: bundle install --local || bundle install
133133
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
134134
- run: bundle exec rake test:valgrind
@@ -189,7 +189,7 @@ jobs:
189189
if: matrix.sys == 'disable'
190190
with:
191191
path: ports
192-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
192+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
193193
- run: bundle install --local || bundle install
194194
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
195195
- run: bundle exec rake test
@@ -214,7 +214,7 @@ jobs:
214214
if: matrix.sys == 'disable'
215215
with:
216216
path: ports
217-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
217+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
218218
- run: bundle install --local || bundle install
219219
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
220220
- run: bundle exec rake test:valgrind
@@ -365,7 +365,7 @@ jobs:
365365
if: matrix.sys == 'disable'
366366
with:
367367
path: ports
368-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
368+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
369369
- run: bundle install --local || bundle install
370370
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
371371
- run: bundle exec rake test:memcheck

.github/workflows/downstream.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,50 @@ jobs:
2727
- url: https://github.com/flavorjones/loofah
2828
name: loofah
2929
command: "bundle exec rake test"
30+
ruby: "3.2"
3031
- url: https://github.com/rails/rails-html-sanitizer
3132
name: rails-html-sanitizer
3233
command: "bundle exec rake test"
34+
ruby: "3.2"
3335
- url: https://github.com/rgrove/sanitize
3436
name: sanitize
3537
command: "bundle exec rake test"
38+
ruby: "3.2"
3639
- url: https://github.com/ebeigarts/signer
3740
name: signer
3841
command: "bundle exec rake spec"
42+
ruby: "3.2"
3943
- url: https://github.com/WinRb/Viewpoint
4044
name: viewpoint
4145
command: "bundle exec rspec spec"
46+
ruby: "3.1"
4247
- url: https://github.com/rails/rails
4348
name: xmlmini
4449
command: "cd activesupport && bundle exec rake test TESTOPTS=-n/XmlMini/"
50+
ruby: "3.2"
4551
- url: https://github.com/pythonicrubyist/creek
4652
name: creek
4753
command: "bundle exec rake spec"
54+
ruby: "3.2"
4855
- url: https://github.com/SAML-Toolkits/ruby-saml
4956
name: ruby-saml
5057
command: "bundle exec rake test MT_COMPAT=t"
58+
ruby: "3.2"
5159
# - url: https://github.com/instructure/nokogiri-xmlsec-instructure
5260
# name: nokogiri-xmlsec-instructure
5361
# precommand: "apt install -y libxmlsec1-dev"
5462
# command: "bundle exec rake compile rspec"
5563
runs-on: ubuntu-latest
5664
container:
57-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
65+
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
5866
steps:
5967
- uses: actions/checkout@v3
6068
with:
6169
submodules: true
6270
- uses: actions/cache@v3
6371
with:
6472
path: ports
65-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
73+
key: ports-ubuntu-${{matrix.ruby}}-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
6674
- if: matrix.precommand
6775
run: ${{matrix.precommand}}
6876
- run: gem install bundler -v ">= 2.3.22" # for "add --path"

.github/workflows/upstream.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
if: matrix.sys == 'disable'
143143
with:
144144
path: ports
145-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
145+
key: ports-ubuntu-head-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
146146
- run: bundle exec rake compile -- --${{matrix.sys}}-system-libraries
147147
- run: bundle exec rake test:valgrind
148148
- run: bundle exec rake test:memcheck
@@ -164,15 +164,15 @@ jobs:
164164
html5lib-tests:
165165
runs-on: ubuntu-latest
166166
container:
167-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
167+
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.2
168168
steps:
169169
- uses: actions/checkout@v3
170170
with:
171171
submodules: true
172172
- uses: actions/cache@v3
173173
with:
174174
path: ports
175-
key: ports-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
175+
key: ports-ubuntu-3.2-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
176176
- name: Update html5lib-tests
177177
run: |
178178
cd test/html5lib-tests

0 commit comments

Comments
 (0)