diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index b11e866..32aa490 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -1,33 +1,78 @@ -name: Build, Test, Dialyze - +name: CI on: - pull_request: - branches: - - 'main' push: branches: - - 'main' - + - '*' + pull_request: + branches: + - main jobs: - linux: - name: Test on OTP ${{ matrix.otp_version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - + build: strategy: + fail-fast: false matrix: - otp_version: [21.2, 22, 23, 24, 25.1] - os: [ubuntu-latest] - - container: - image: erlang:${{ matrix.otp_version }} - + include: + - os: ubuntu-20.04 + otp-version: 21.3 + rebar3-version: 3.15 + - os: ubuntu-20.04 + otp-version: 22.3 + rebar3-version: 3.16 + - os: ubuntu-20.04 + otp-version: 23.3 + rebar3-version: 3.19 + - os: ubuntu-20.04 + otp-version: 24.3 + rebar3-version: 3.22 + - os: ubuntu-20.04 + otp-version: 25.3 + rebar3-version: 3.22 + - os: ubuntu-22.04 + otp-version: 26 + rebar3-version: 3.22 + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Compile - run: rebar3 compile - - name: CT tests - run: rebar3 do edoc,ct - - shell: bash - name: Dialyzer - run: rebar3 dialyzer + - name: Checkout + uses: actions/checkout@v2 + - uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp-version}} + rebar3-version: ${{matrix.rebar3-version}} + - name: Cache Hex packages + uses: actions/cache@v1 + with: + path: ~/.cache/rebar3/hex/hexpm/packages + key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }} + restore-keys: | + ${{ runner.os }}-hex- + - name: Compile + run: rebar3 compile + - name: Edoc + run: rebar3 edoc + - name: Test + run: rebar3 ct + dialyzer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: erlef/setup-beam@v1 + with: + otp-version: 26 + rebar3-version: 3.22 + - name: Cache Dialyzer PLTs + uses: actions/cache@v1 + with: + path: ~/.cache/rebar3/rebar3_*.plt + key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }} + restore-keys: | + ${{ runner.os }}-dialyzer- + - name: Cache Dialyzer PLTs + uses: actions/cache@v1 + with: + path: ~/.cache/rebar3/rebar3_*.plt + key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }} + restore-keys: | + ${{ runner.os }}-dialyzer- + - name: Dialyzer + run: rebar3 dialyzer