-
Notifications
You must be signed in to change notification settings - Fork 17
119 lines (101 loc) · 2.92 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
name: Test
on:
push:
branches: [ master ]
schedule:
- cron: '0 0 11,25 * *' # roughly every two weeks to run on new Ruby versions
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
name: "Unit"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
ruby:
- "2.1"
- "2.2"
- "2.3"
- "2.4"
- "2.5"
- "2.6"
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "truffleruby"
exclude:
# TruffleRuby does not support Windows.
- { ruby: "truffleruby", os: "windows-latest" }
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Test
run: bundle exec rake
system:
name: "System"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
ruby:
# This includes rubies that are not actually extended by this gem.
# We want to make sure the gem silently fails to load on those platforms.
- "2"
- "3.0"
- "jruby"
- "truffleruby"
exclude:
# Windows releases of jruby have issues. Skip them for now.
- { ruby: "jruby", os: "windows-latest" }
# TruffleRuby does not support Windows.
- { ruby: "truffleruby", os: "windows-latest" }
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Build gem
run: bundle exec gem build --verbose debug_inspector.gemspec
- name: Install gem
run: gem install --verbose debug_inspector*.gem
- name: Create directory for gem test
run: mkdir -p tmp/gem-test
- name: Create test Gemfile
run: echo "gem 'debug_inspector'" > Gemfile
working-directory: ./tmp/gem-test
- name: Get gem installation path
id: gem_path
run: |
gem_path=$(bundle show debug_inspector)
echo "gem_path is ${gem_path}"
echo "::set-output name=path::${gem_path}"
shell: bash
working-directory: ./tmp/gem-test
- name: List installed gem contents
run: find .
shell: bash
working-directory: ${{ steps.gem_path.outputs.path }}
- name: Test gem load
run: bundle exec ruby -e "require 'debug_inspector'"
working-directory: ./tmp/gem-test
- name: Test gem functionality
if: ${{ matrix.ruby != 'jruby' }}
run: bundle exec ruby -e "require 'debug_inspector'; DebugInspector.open { |dc| dc.frame_binding(1) }"
working-directory: ./tmp/gem-test