forked from ruby/setup-ruby
-
Notifications
You must be signed in to change notification settings - Fork 2
167 lines (155 loc) · 4.96 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Test this action
on:
pull_request:
push:
branches-ignore:
- v1
tags-ignore:
- '*'
paths-ignore:
- README.md
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2016, windows-2019 ]
ruby: [ '2.0', 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head ]
include:
- { os: windows-2016, ruby: mingw }
- { os: windows-2019, ruby: mingw }
- { os: windows-2019, ruby: mswin }
exclude:
- { os: windows-2016, ruby: debug }
- { os: windows-2016, ruby: truffleruby }
- { os: windows-2016, ruby: truffleruby-head }
- { os: windows-2019, ruby: debug }
- { os: windows-2019, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head }
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: ruby -v
- name: PATH
shell: pwsh
run: |
# Show PATH with Powershell
$f, $r = $env:PATH.split([IO.Path]::PathSeparator); $r
- name: build compiler
run: |
ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first"
- name: gcc and ridk version (mingw)
if: startsWith(matrix.os, 'windows')
run: |
$abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ')
if ($plat.Contains('mingw')) {
gcc --version
if ($abi -ge '2.4') {
ridk version
} else {
echo 'ridk is unavailable'
}
}
- name: RbConfig::CONFIG
run: ruby -rrbconfig -rpp -e 'pp RbConfig::CONFIG'
- name: RbConfig::MAKEFILE_CONFIG
run: ruby -rrbconfig -rpp -e 'pp RbConfig::MAKEFILE_CONFIG'
- name: Subprocess test
run: ruby test_subprocess.rb
- name: OpenSSL version
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
- name: OpenSSL test
run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }'
- run: gem env
- name: C extension test
run: gem install json:2.2.0 --no-document
- run: bundle --version
# This step is redundant with `bundler-cache: true` but is there to check a redundant `bundle install` still works
- run: bundle install
- run: bundle exec rake --version
- run: bundle exec rake
- name: which ruby, rake
if: "!startsWith(matrix.os, 'windows')"
run: which -a ruby rake
- name: where ruby, rake
if: startsWith(matrix.os, 'windows')
run: |
$ErrorActionPreference = 'Continue'
$where = 'ruby', 'rake'
foreach ($e in $where) {
$rslt = where.exe $e 2>&1 | Out-String
if ($rslt.contains($e)) { echo $rslt.Trim() }
else { echo "Can't find $e" }
echo ''
}
- name: bash test
shell: bash
run: echo ~
- name: Windows JRuby
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
run: gem install sassc
testExactBundlerVersion:
name: "Test with an exact Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
ruby-version: 2.6
bundler: 2.2.3
- run: bundle --version | grep -F "Bundler version 2.2.3"
testDependencyOnBundler1:
name: "Test gemfile depending on Bundler 1"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
steps:
- uses: actions/checkout@v2
- uses: ./
with:
ruby-version: 2.7
bundler: 1
bundler-cache: true
- run: bundle --version | grep -F "Bundler version 1."
testGemfileMatrix:
strategy:
fail-fast: false
matrix:
gemfile: [ rails5, rails6 ]
name: "Test with ${{ matrix.gemfile }} gemfile"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: ./
with:
ruby-version: 2.6
bundler-cache: true
- run: bundle exec rails --version
testTruffleRubyNokogiri:
name: "Test installing a Gemfile with nokogiri on TruffleRuby"
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/nokogiri.gemfile
steps:
- uses: actions/checkout@v2
- uses: ./
with:
ruby-version: truffleruby-head
bundler-cache: true
- run: bundle list | grep nokogiri
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn run package
- name: Check generated files are up to date
run: git diff --exit-code