-
Notifications
You must be signed in to change notification settings - Fork 438
71 lines (67 loc) · 2.23 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
name: Test
on: [push, pull_request]
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
min_version: 3.0
test:
needs: ruby-versions
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: windows-latest
ruby: truffleruby
- os: windows-latest
ruby: truffleruby-head
- os: windows-latest
ruby: jruby
- os: windows-latest
ruby: jruby-head
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4 # v3.3.0
# libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install libyaml-dev
- name: Set up Ruby
uses: ruby/setup-ruby@master
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # 'bundle install' and cache
# Avoid issues on these platforms
- if: ${{ matrix.ruby == '2.6' }}
run: gem update --system
- name: Run test
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
- name: Run test with Prism parser
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
RDOC_USE_PRISM_PARSER: true
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rdoc
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake install
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
# Just to make sure the format_generated_files task is working
- name: Sanity check for the format_generated_files task
run: bundle exec rake generate format_generated_files