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

jobs:
  test:
    runs-on: ubuntu-latest
    name: Tests on ${{matrix.otp}}
    strategy:
      matrix:
        otp: ['24.1.2', '23.3.4.7', '22.3.4.22', '21.3.8.24']
    steps:
      - uses: actions/checkout@v2
      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{matrix.otp}}
          rebar3-version: 3.15.1
      - name: Common Test tests
        run: rebar3 ct --sname ct
      - name: Dialyzer
        run: rebar3 dialyzer

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

jobs:
  test:
    runs-on: ubuntu-latest
    name: Tests on OTP ${{matrix.otp}} with rebar v${{matrix.rebar3}}
    strategy:
      matrix:
        otp: ['24.1.2', '23.3.4.7', '22.3.4.22']
        rebar3: ['3.17.0']
        include:
          - otp: '21.3.8.24'
            rebar3: '3.15.1'
    steps:
      - uses: actions/checkout@v2
      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{matrix.otp}}
          rebar3-version: ${{matrix.rebar3}}
      - name: Common Test tests
        run: rebar3 ct --sname ct
      - name: Dialyzer
        run: rebar3 dialyzer

Use different version of rebar3 for OTP 21 in github actions.
Use different version of rebar3 for OTP 21 in github actions.
