|
7 | 7 | branches: [master]
|
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - build: |
11 |
| - name: Build and test |
12 |
| - runs-on: ubuntu-18.04 |
| 10 | + lint: |
| 11 | + name: Lint (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}) |
| 12 | + runs-on: ubuntu-latest |
13 | 13 | strategy:
|
14 | 14 | matrix:
|
15 |
| - elixir: [1.9, 1.12] |
16 |
| - otp: [23.0] |
17 |
| - |
| 15 | + otp: ['25'] |
| 16 | + elixir: ['1.13'] |
18 | 17 | steps:
|
19 | 18 | - uses: actions/checkout@v2
|
20 |
| - - name: Set up Elixir |
21 |
| - uses: actions/setup-elixir@v1 |
| 19 | + - uses: erlef/setup-beam@v1 |
| 20 | + id: beam |
22 | 21 | with:
|
23 |
| - elixir-version: ${{ matrix.elixir }} # Define the elixir version [required] |
24 |
| - otp-version: ${{ matrix.otp }} # Define the OTP version [required] |
25 |
| - - name: Restore dependencies cache |
| 22 | + otp-version: ${{matrix.otp}} |
| 23 | + elixir-version: ${{matrix.elixir}} |
| 24 | + - name: PLT cache |
26 | 25 | uses: actions/cache@v2
|
27 | 26 | with:
|
| 27 | + key: | |
| 28 | + ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt |
| 29 | + restore-keys: | |
| 30 | + ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt |
| 31 | + path: | |
| 32 | + priv/plts |
| 33 | + - run: mix deps.get |
| 34 | + - run: mix compile --warnings-as-errors |
| 35 | + - run: mix format --check-formatted |
| 36 | + - run: mix credo --strict --all |
| 37 | + - run: mix dialyzer |
| 38 | + test: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + name: Test (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}) |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + otp: ['22', '23', '24', '25'] |
| 44 | + elixir: ['1.10', '1.11', '1.12', '1.13'] |
| 45 | + exclude: |
| 46 | + - {otp: '24', elixir: '1.10'} |
| 47 | + - {otp: '25', elixir: '1.10'} |
| 48 | + - {otp: '25', elixir: '1.11'} |
| 49 | + - {otp: '25', elixir: '1.12'} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v2 |
| 52 | + - uses: erlef/setup-beam@v1 |
| 53 | + with: |
| 54 | + otp-version: ${{matrix.otp}} |
| 55 | + elixir-version: ${{matrix.elixir}} |
| 56 | + - uses: actions/cache@v2 |
| 57 | + with: |
| 58 | + key: | |
| 59 | + ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-build |
| 60 | + restore-keys: | |
| 61 | + ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-build |
28 | 62 | path: |
|
29 |
| - deps |
30 |
| - _build/test |
31 |
| - key: ${{ runner.os }}-deps-${{ hashFiles('**/mix.lock', '**/config/*.exs') }} |
32 |
| - restore-keys: ${{ runner.os }}-deps- |
33 |
| - - name: Install and compile dependencies |
34 |
| - run: MIX_ENV=test mix do deps.get, deps.compile |
35 |
| - - name: Compile application |
36 |
| - run: MIX_ENV=test mix compile --warnings-as-errors |
37 |
| - - name: Check formatting |
38 |
| - if: ${{ matrix.elixir == '1.12' }} |
39 |
| - run: mix format --check-formatted |
40 |
| - - name: Run tests |
41 |
| - run: mix test |
| 63 | + _build |
| 64 | + - run: mix deps.get |
| 65 | + - run: mix test |
0 commit comments