mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
111 lines
3.5 KiB
YAML
111 lines
3.5 KiB
YAML
name: Test this action
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches-ignore:
|
|
- v1
|
|
tags-ignore:
|
|
- '*'
|
|
paths-ignore:
|
|
- README.md
|
|
schedule:
|
|
- cron: '0 7 * * SUN'
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
|
|
# Use various version syntax here for testing
|
|
ruby: [ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
|
|
include:
|
|
- { os: ubuntu-18.04, ruby: rubinius }
|
|
- { 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: bash
|
|
run: echo $PATH
|
|
|
|
- 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) }'
|
|
|
|
- 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
|
|
|
|
- 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 -N
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
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
|