summaryrefslogtreecommitdiff
path: root/.github/workflows/test.yml
blob: e3a6abda01ff9e6e44f6e0c0b1deccb48075b7cf (plain)
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
name: pry

on: [push]

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest]
        ruby:
          - 2.0
          - 2.1
          - 2.2
          - 2.3
          - 2.4
          - 2.5
          - 2.6
          - 2.7
          # Due to https://github.com/actions/runner/issues/849,
          # we have to use quotes for '3.0'
          - '3.0'
          - head
          - jruby
          - jruby-head

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2

    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true

    - name: Rubocop lint
      run: |
        if bundle list | grep rubocop
        then
            bundle exec rubocop --parallel
        fi

    - name: YARD lint
      run: |
        touch README # Workaround for "incorrect" links in README.md
        bundle exec yardoc --fail-on-warning --no-progress --readme=README

    - name: Display Ruby version
      run: ruby -v

    - name: Test
      run: bundle exec rake
      env:
        # Make sure TERM is set so Pry can indent correctly inside tests.
        TERM: screen-256color