Merge pull request #317 from paulo-ferraz-oliveira/feature/minor-main… #338
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: build | |
on: [push, pull_request] | |
jobs: | |
ci: | |
name: OTP ${{matrix.otp_vsn}} on ${{matrix.os}} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
otp_vsn: ['24', '25', '26'] | |
rebar3_vsn: ['3.22'] | |
os: [ubuntu-22.04, windows-2022] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
id: setup-beam | |
with: | |
otp-version: ${{matrix.otp_vsn}} | |
rebar3-version: ${{matrix.rebar3_vsn}} | |
- name: Restore _build | |
uses: actions/cache@v3 | |
with: | |
path: _build | |
key: "_build-cache-for\ | |
-os-${{runner.os}}\ | |
-otp-${{steps.setup-beam.outputs.otp-version}}\ | |
-rebar3-${{steps.setup-beam.outputs.rebar3-version}}\ | |
-hash-${{hashFiles('rebar.lock')}}" | |
- name: Restore rebar3's cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/rebar3 | |
key: "rebar3-cache-for\ | |
-os-${{runner.os}}\ | |
-otp-${{steps.setup-beam.outputs.otp-version}}\ | |
-rebar3-${{steps.setup-beam.outputs.rebar3-version}}\ | |
-hash-${{hashFiles('rebar.lock')}}" | |
- name: Compile | |
run: rebar3 compile | |
- name: Format check | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: rebar3 format --verify | |
- name: Run test | |
run: rebar3 test | |
- name: Run elvis on elvis | |
run: | | |
rebar3 escriptize | |
_build/default/bin/elvis_core |