summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 3ddc090f7509f8f24ec12ad2c356698c743aad17 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  danger:
    runs-on: ubuntu-latest
    if: ${{ github.event_name == 'pull_request' }}
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.7
    - uses: MeilCli/danger-action@v5
      with:
        danger_file: Dangerfile
        danger_id: danger-pr
        install_path: vendor/bundle
        plugins_file: Gemfile
      env:
        DANGER_GITHUB_API_TOKEN: ${{ secrets.github_token }}

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - 2.7
          - 2.6
          - 2.5
          - 2.4
          - 2.3
          - 2.2
          - 2.1
    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true
        ruby-version: ${{ matrix.ruby }}
    - name: Install dependencies
      run: bundle install --jobs 4 --retry 3
    - name: Run tests
      run: bundle exec rake

  test-jruby:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos
          - ubuntu
        jruby:
          - jruby
    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true
        ruby-version: ${{ matrix.jruby }}
    - name: Install dependencies
      env:
        JRUBY_OPTS: --debug
      run: bundle install --jobs 4 --retry 3
    - name: Run tests
      env:
        JRUBY_OPTS: --debug
      run: bundle exec rake