Only check formatting on >= OTP 27 #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
name: Erlang ${{matrix.otp}} / rebar ${{matrix.rebar3}} | |
strategy: | |
matrix: | |
otp: ['25', '26', '27'] | |
rebar3: ['3'] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
rebar3-version: ${{matrix.rebar3}} | |
- uses: actions/cache@v2 | |
env: | |
cache-name: rebar3 | |
with: | |
path: | | |
~/.cache/rebar3 | |
_build | |
key: ci-${{runner.os}}-${{env.cache-name}}-otp_${{matrix.otp}}-rebar_${{matrix.rebar3}}-${{hashFiles('rebar.lock')}} | |
restore-keys: | | |
ci-${{runner.os}}-${{env.cache-name}}-otp_${{matrix.otp}}-rebar_${{matrix.rebar3}} | |
ci-${{runner.os}}-${{env.cache-name}}-otp_${{matrix.otp}} | |
- name: Upgrade all plugins | |
run: rebar3 plugins upgrade --all | |
- name: Compile | |
run: rebar3 do clean, compile | |
- name: Check formatting | |
if: ${{ fromJson(matrix.otp) >= 27 }} | |
run: rebar3 fmt --check | |
- name: Analyze | |
run: rebar3 do xref, dialyzer | |
- name: Test | |
run: rebar3 do eunit, ct |