Skip to content

Commit 2c736cb

Browse files
committed
Test with the Ruby in PATH
1 parent 11317ef commit 2c736cb

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed

.github/workflows/build.yml

+31-26
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ jobs:
4949
gem install bundler -v '~> 1' --no-document
5050
fi
5151
52-
- name: Basic test
53-
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby --version
52+
- run: echo "::add-path::$HOME/.rubies/${{ matrix.ruby }}/bin"
53+
- uses: actions/checkout@v2
54+
- run: ruby --version
55+
- run: ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
56+
- run: gem install json:2.2.0 --no-document
57+
- run: bundle --version
58+
- run: bundle install
59+
- run: bundle exec rake --version
5460
- name: Subprocess test
55-
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby -e 'p RbConfig::CONFIG["CPPFLAGS"]; def Warning.warn(s); raise s; end; system RbConfig.ruby, "-e", "p :OK"'
56-
- name: OpenSSL test
57-
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
58-
- name: Bundler version
59-
run: |
60-
export PATH="$HOME/.rubies/${{ matrix.ruby }}/bin:$PATH"
61-
bundle --version
61+
run: ruby -e 'p RbConfig::CONFIG["CPPFLAGS"]; def Warning.warn(s); raise s; end; system RbConfig.ruby, "-e", "p :OK"'
6262

6363
- name: Create archive
6464
run: tar czf ${{ matrix.ruby }}-${{ matrix.os }}.tar.gz -C ~/.rubies ${{ matrix.ruby }}
@@ -187,18 +187,20 @@ jobs:
187187
export PATH="$HOME/.rubies/ruby-${{ matrix.ruby-version }}/bin:$PATH"
188188
gem install bundler -v '~> 1' --no-document
189189
fi
190+
- name: Create archive
191+
run: tar czf ruby-${{ matrix.ruby-version }}-${{ matrix.os }}.tar.gz -C ~/.rubies ruby-${{ matrix.ruby-version }}
190192

191-
- name: Basic test
192-
run: ~/.rubies/ruby-${{ matrix.ruby-version }}/bin/ruby --version
193+
- run: echo "::add-path::$HOME/.rubies/ruby-${{ matrix.ruby-version }}/bin"
194+
- uses: actions/checkout@v2
195+
- run: ruby --version
196+
- run: ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
197+
- run: gem install json:2.2.0 --no-document
198+
- run: bundle --version
199+
- run: bundle install
200+
- run: bundle exec rake --version
193201
- name: Subprocess test
194-
run: ~/.rubies/ruby-${{ matrix.ruby-version }}/bin/ruby -rstringio -e 'p RbConfig::CONFIG["CPPFLAGS"]; $stderr = StringIO.new; system RbConfig.ruby, "-e", "p :OK"; out=$stderr.string; $stderr=STDERR; abort out unless out.empty?'
195-
- name: OpenSSL test
196-
run: ~/.rubies/ruby-${{ matrix.ruby-version }}/bin/ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
197-
- name: Bundler version
198-
run: ~/.rubies/ruby-${{ matrix.ruby-version }}/bin/bundle --version
202+
run: ruby -rstringio -e 'p RbConfig::CONFIG["CPPFLAGS"]; $stderr = StringIO.new; system RbConfig.ruby, "-e", "p :OK"; out=$stderr.string; $stderr=STDERR; abort out unless out.empty?'
199203

200-
- name: Create archive
201-
run: tar czf ruby-${{ matrix.ruby-version }}-${{ matrix.os }}.tar.gz -C ~/.rubies ruby-${{ matrix.ruby-version }}
202204
- name: Upload Built Ruby
203205
uses: actions/[email protected]
204206
env:
@@ -243,16 +245,19 @@ jobs:
243245
./configure --prefix=$HOME/.rubies/${{ matrix.ruby }}
244246
make
245247
make install
246-
247-
- name: Basic test
248-
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby --version
249-
- name: OpenSSL test
250-
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
251-
- name: Bundler version
252-
run: ~/.rubies/${{ matrix.ruby }}/gems/bin/bundle --version
253-
254248
- name: Create archive
255249
run: tar czf ${{ matrix.ruby }}-${{ matrix.os }}.tar.gz -C ~/.rubies ${{ matrix.ruby }}
250+
251+
- run: echo "::add-path::$HOME/.rubies/${{ matrix.ruby }}/bin"
252+
- run: echo "::add-path::$HOME/.rubies/${{ matrix.ruby }}/gems/bin"
253+
- uses: actions/checkout@v2
254+
- run: ruby --version
255+
- run: ruby -ropen-uri -e 'puts open("https://rubygems.org/") { |f| f.read(1024) }'
256+
- run: gem install json:2.2.0 --no-document
257+
- run: bundle --version
258+
- run: bundle install
259+
- run: bundle exec rake --version
260+
256261
- name: Upload Built Ruby
257262
uses: actions/[email protected]
258263
env:

Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Used for testing
2+
source 'https://rubygems.org'
3+
4+
gem "rake"
5+
gem "path"
6+
gem "json", "2.2.0"

0 commit comments

Comments
 (0)