Skip to content

Commit 55029bf

Browse files
authored
Merge pull request #2408 from sparklemotion/2397-support-ruby-3-1
ci: test coverage for ruby 3.1
2 parents dcccf72 + bb9f952 commit 55029bf

File tree

8 files changed

+107
-53
lines changed

8 files changed

+107
-53
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
rubocop:
2222
runs-on: ubuntu-latest
2323
container:
24-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.0
24+
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
2525
steps:
2626
- uses: actions/checkout@v2
2727
with:
@@ -47,7 +47,7 @@ jobs:
4747
submodules: true
4848
- uses: MSP-Greg/setup-ruby-pkgs@v1
4949
with:
50-
ruby-version: "3.0"
50+
ruby-version: "3.0" # OK for now, until ruby 3.1 CI is stable
5151
apt-get: "ragel"
5252
brew: "ragel"
5353
mingw: "ragel"
@@ -78,7 +78,7 @@ jobs:
7878
fail-fast: false
7979
matrix:
8080
sys: ["enable", "disable"]
81-
ruby: ["2.6", "2.7", "3.0"]
81+
ruby: ["2.6", "2.7", "3.0", "3.1"]
8282
runs-on: ubuntu-latest
8383
container:
8484
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
@@ -101,7 +101,7 @@ jobs:
101101
fail-fast: false
102102
matrix:
103103
sys: ["enable", "disable"]
104-
ruby: ["2.6", "2.7", "3.0"]
104+
ruby: ["2.6", "2.7", "3.0", "3.1"]
105105
runs-on: ubuntu-latest
106106
container:
107107
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}
@@ -160,7 +160,7 @@ jobs:
160160
fail-fast: false
161161
matrix:
162162
sys: ["enable"]
163-
ruby: ["3.0"]
163+
ruby: ["3.1"]
164164
env:
165165
BUNDLE_GEMFILE: "Gemfile-libxml-ruby"
166166
runs-on: ubuntu-latest
@@ -185,7 +185,7 @@ jobs:
185185
fail-fast: false
186186
matrix:
187187
sys: ["disable"]
188-
ruby: ["3.0"]
188+
ruby: ["3.1"]
189189
env:
190190
BUNDLE_GEMFILE: "Gemfile-libxml-ruby"
191191
runs-on: ubuntu-latest
@@ -210,7 +210,7 @@ jobs:
210210
fail-fast: false
211211
matrix:
212212
sys: ["enable", "disable"]
213-
ruby: ["2.6", "2.7", "3.0"]
213+
ruby: ["2.6", "2.7", "3.0", "3.1"]
214214
runs-on: macos-latest
215215
steps:
216216
- uses: actions/checkout@v2
@@ -234,8 +234,8 @@ jobs:
234234
fail-fast: false
235235
matrix:
236236
sys: ["enable", "disable"]
237-
ruby: ["2.6", "2.7", "3.0", "mingw"]
238-
runs-on: windows-latest
237+
ruby: ["2.6", "2.7", "3.0", "3.1", "mingw", "head"]
238+
runs-on: windows-2022
239239
steps:
240240
- name: configure git crlf
241241
run: |
@@ -244,11 +244,12 @@ jobs:
244244
- uses: actions/checkout@v2
245245
with:
246246
submodules: true
247-
- uses: MSP-Greg/setup-ruby-pkgs@v1
247+
- uses: MSP-Greg/setup-ruby-pkgs@win-ucrt-2
248248
with:
249249
ruby-version: "${{matrix.ruby}}"
250250
mingw: "libxml2 libxslt"
251251
bundler-cache: true
252+
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/win-ucrt-1
252253
- uses: actions/cache@v2
253254
if: matrix.sys == 'disable'
254255
with:
@@ -302,7 +303,7 @@ jobs:
302303
fail-fast: false
303304
matrix:
304305
sys: ["disable"]
305-
ruby: ["3.0"]
306+
ruby: ["3.1"]
306307
runs-on: ubuntu-latest
307308
container:
308309
image: ghcr.io/sparklemotion/nokogiri-test:mri-${{matrix.ruby}}

.github/workflows/gem-install.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
sys: ["enable", "disable"]
45-
ruby: ["2.6", "2.7", "3.0", "head"]
45+
ruby: ["2.6", "2.7", "3.0", "3.1", "head"]
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v2
@@ -71,7 +71,7 @@ jobs:
7171
submodules: true
7272
- uses: ruby/setup-ruby@v1
7373
with:
74-
ruby-version: "3.0"
74+
ruby-version: "3.1"
7575
- uses: actions/download-artifact@v2
7676
with:
7777
name: cruby-gem
@@ -102,6 +102,30 @@ jobs:
102102
gem list -d nokogiri
103103
nokogiri -v
104104
105+
cruby-windows-install-ucrt:
106+
needs: ["cruby-package"]
107+
strategy:
108+
fail-fast: false
109+
matrix:
110+
sys: ["enable", "disable"]
111+
runs-on: windows-2022
112+
steps:
113+
- uses: actions/checkout@v2
114+
with:
115+
submodules: true
116+
- uses: MSP-Greg/setup-ruby-pkgs@win-ucrt-2
117+
with:
118+
ruby-version: "3.1"
119+
mingw: "libxml2 libxslt"
120+
setup-ruby-ref: MSP-Greg/ruby-setup-ruby/win-ucrt-1
121+
- uses: actions/download-artifact@v2
122+
with:
123+
name: cruby-gem
124+
path: gems
125+
- run: |
126+
gem install --verbose --no-document gems/*.gem -- --${{matrix.sys}}-system-libraries
127+
gem list -d nokogiri
128+
nokogiri -v
105129
106130
cruby-native-package:
107131
name: "cruby-native-package"

.github/workflows/generate-ci-images.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
submodules: true
1616
- uses: ruby/setup-ruby@v1
1717
with:
18-
ruby-version: "3.0"
18+
ruby-version: "3.1"
1919
bundler-cache: true
2020
- uses: docker/setup-buildx-action@v1
2121
- uses: docker/login-action@v1
@@ -30,20 +30,6 @@ jobs:
3030
push: true
3131
tags: ghcr.io/sparklemotion/nokogiri-test:alpine
3232
file: oci-images/nokogiri-test/alpine.dockerfile
33-
- name: ubuntu
34-
uses: docker/build-push-action@v2
35-
with:
36-
context: "."
37-
push: true
38-
tags: ghcr.io/sparklemotion/nokogiri-test:ubuntu
39-
file: oci-images/nokogiri-test/ubuntu.dockerfile
40-
- name: ubuntu32
41-
uses: docker/build-push-action@v2
42-
with:
43-
context: "."
44-
push: true
45-
tags: ghcr.io/sparklemotion/nokogiri-test:ubuntu32
46-
file: oci-images/nokogiri-test/ubuntu32.dockerfile
4733
- name: mri-2.6
4834
uses: docker/build-push-action@v2
4935
with:
@@ -65,10 +51,31 @@ jobs:
6551
push: true
6652
tags: ghcr.io/sparklemotion/nokogiri-test:mri-3.0
6753
file: oci-images/nokogiri-test/mri-3.0.dockerfile
54+
- name: mri-3.1
55+
uses: docker/build-push-action@v2
56+
with:
57+
context: "."
58+
push: true
59+
tags: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
60+
file: oci-images/nokogiri-test/mri-3.1.dockerfile
6861
- name: truffle-nightly
6962
uses: docker/build-push-action@v2
7063
with:
7164
context: "."
7265
push: true
7366
tags: ghcr.io/sparklemotion/nokogiri-test:truffle-nightly
7467
file: oci-images/nokogiri-test/truffle-nightly.dockerfile
68+
- name: ubuntu
69+
uses: docker/build-push-action@v2
70+
with:
71+
context: "."
72+
push: true
73+
tags: ghcr.io/sparklemotion/nokogiri-test:ubuntu
74+
file: oci-images/nokogiri-test/ubuntu.dockerfile
75+
- name: ubuntu32
76+
uses: docker/build-push-action@v2
77+
with:
78+
context: "."
79+
push: true
80+
tags: ghcr.io/sparklemotion/nokogiri-test:ubuntu32
81+
file: oci-images/nokogiri-test/ubuntu32.dockerfile

.github/workflows/upstream.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
xmlsoft-head:
2222
runs-on: ubuntu-latest
2323
container:
24-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.0
24+
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
2525
steps:
2626
- uses: actions/checkout@v2
2727
with:
@@ -46,7 +46,7 @@ jobs:
4646
needs: ["xmlsoft-head"]
4747
runs-on: ubuntu-latest
4848
container:
49-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.0
49+
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
5050
steps:
5151
- uses: actions/checkout@v2
5252
with:
@@ -138,7 +138,7 @@ jobs:
138138
html5lib-tests:
139139
runs-on: ubuntu-latest
140140
container:
141-
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.0
141+
image: ghcr.io/sparklemotion/nokogiri-test:mri-3.1
142142
steps:
143143
- uses: actions/checkout@v2
144144
with:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Clone https://github.com/sparklemotion/nokogiri and run `bundle install`.
7979

8080
### Advanced
8181

82-
Please install the latest or previous version of CRuby (e.g., 3.0 or 2.7 as of 2021-02), and a recent version of JRuby. We recommend using `rbenv`, which is used in test scripts when necessary to test gems against multiple rubies.
82+
Please install the latest or previous version of CRuby (e.g., 3.1 or 3.0 as of 2022-01), and a recent version of JRuby. We recommend using `rbenv`, which is used in test scripts when necessary to test gems against multiple rubies.
8383

8484
Please install a system version of libxml2/libxslt (see [Installing Nokogiri](https://nokogiri.org/tutorials/installing_nokogiri.html#installing-using-standard-system-libraries) for details) so that you can test against both the packaged libraries and your system libraries.
8585

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM ruby:3.1
2+
3+
# -*- dockerfile -*-
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
RUN apt-get update
7+
RUN apt-get upgrade -y
8+
RUN apt-get install -y apt-utils
9+
10+
11+
# -*- dockerfile -*-
12+
13+
RUN apt-get install -y valgrind
14+
15+
16+
# -*- dockerfile -*-
17+
18+
RUN apt-get install -y libxslt-dev libxml2-dev zlib1g-dev pkg-config
19+
20+
21+
# -*- dockerfile -*-
22+
23+
RUN gem install bundler
24+
25+
26+
# -*- dockerfile -*-
27+
28+
COPY Gemfile nokogiri/
29+
COPY Gemfile.lock nokogiri/
30+
COPY nokogiri.gemspec nokogiri/
31+
32+
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" nokogiri/Gemfile.lock | tail -n 1)"
33+
RUN cd nokogiri && bundle install
34+

rakelib/docker.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module DockerHelper
88
IMAGE_DIR = "oci-images/nokogiri-test"
99
IMAGE_NAME = "ghcr.io/sparklemotion/nokogiri-test"
1010
RUBIES = {
11-
mri: ["2.6", "2.7", "3.0"],
11+
mri: ["2.6", "2.7", "3.0", "3.1"],
1212
truffle: ["nightly"],
1313
}
1414

@@ -63,7 +63,7 @@ module DockerHelper
6363
submodules: true
6464
- uses: ruby/setup-ruby@v1
6565
with:
66-
ruby-version: "3.0"
66+
ruby-version: "3.1"
6767
bundler-cache: true
6868
- uses: docker/setup-buildx-action@v1
6969
- uses: docker/login-action@v1
@@ -87,7 +87,7 @@ EOF
8787
File.open(filename, "w") do |io|
8888
io.write(pipeline_prelude)
8989

90-
Dir.glob(File.join(IMAGE_DIR, "*.dockerfile")).each do |dockerfile|
90+
Dir.glob(File.join(IMAGE_DIR, "*.dockerfile")).sort.each do |dockerfile|
9191
image_tag = Regexp.new("(.*)\.dockerfile").match(File.basename(dockerfile))[1]
9292
template_params = {
9393
job_name: image_tag,

suppressions/nokogiri_ruby.supp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848
Memcheck:Leak
4949
fun:malloc
5050
fun:objspace_xmalloc0
51-
fun:ruby_xmalloc0
52-
fun:ruby_xmalloc_body
53-
fun:ruby_xmalloc
51+
...
5452
fun:xmlXPathNewParserContext
5553
fun:xmlXPathEval
5654
fun:evaluate
@@ -79,9 +77,7 @@
7977
Memcheck:Leak
8078
fun:malloc
8179
fun:objspace_xmalloc0
82-
fun:ruby_xmalloc0
83-
fun:ruby_xmalloc_body
84-
fun:ruby_xmalloc
80+
...
8581
fun:xmlStrndup
8682
fun:xmlXPathParseNCName
8783
...
@@ -127,9 +123,7 @@
127123
Memcheck:Leak
128124
fun:malloc
129125
fun:objspace_xmalloc0
130-
fun:ruby_xmalloc0
131-
fun:ruby_xmalloc_body
132-
fun:ruby_xmalloc
126+
...
133127
fun:xmlXPathNodeSetCreate
134128
fun:xmlXPathNodeCollectAndTest
135129
fun:xmlXPathCompOpEval
@@ -144,9 +138,7 @@
144138
Memcheck:Leak
145139
fun:malloc
146140
fun:objspace_xmalloc0
147-
fun:ruby_xmalloc0
148-
fun:ruby_xmalloc_body
149-
fun:ruby_xmalloc
141+
...
150142
fun:ar_alloc_table
151143
fun:rb_hash_aset
152144
fun:registr
@@ -167,9 +159,7 @@
167159
Memcheck:Leak
168160
fun:malloc
169161
fun:objspace_xmalloc0
170-
fun:ruby_xmalloc0
171-
fun:ruby_xmalloc_body
172-
fun:ruby_xmalloc
162+
...
173163
fun:xmlNewNodeEatName
174164
fun:xmlNewDocNodeEatName
175165
fun:xmlSAX2StartElementNs
@@ -198,9 +188,7 @@
198188
Memcheck:Leak
199189
fun:malloc
200190
fun:objspace_xmalloc0
201-
fun:ruby_xmalloc0
202-
fun:ruby_xmalloc_body
203-
fun:ruby_xmalloc
191+
...
204192
fun:xmlXPathWrapNodeSet
205193
fun:xmlXPathNodeCollectAndTest
206194
...

0 commit comments

Comments
 (0)