Skip to content

Commit eccb52e

Browse files
Refactor CI workflow
- use CargoSense/setup-elixir-project reusable workflow - adds Ubuntu and macOS to the test matrix - specifies oldest and newest Elixir and Erlang combo in the matrix - use latest actions/checkout - sets job name to use matrix values for clarity
1 parent 928cbf8 commit eccb52e

File tree

1 file changed

+14
-33
lines changed

1 file changed

+14
-33
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,29 @@ on:
99

1010
jobs:
1111
test:
12-
runs-on: ubuntu-20.04
12+
name: Elixir ${{ matrix.pair.elixir }} OTP ${{ matrix.pair.otp }} (${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
1314
env:
1415
MIX_ENV: test
1516
strategy:
1617
fail-fast: false
1718
matrix:
19+
os:
20+
- ubuntu-latest
21+
- macos-latest
1822
include:
1923
- pair:
20-
elixir: "1.11"
21-
otp: 22
24+
elixir: "1.13"
25+
otp: "24.3.4.10"
2226
- pair:
23-
elixir: "1.14"
24-
otp: 25
25-
lint: lint
27+
elixir: "1.17"
28+
otp: "27.0.1"
2629
steps:
27-
- uses: actions/checkout@v3
28-
29-
- uses: erlef/setup-beam@v1
30-
with:
31-
otp-version: ${{matrix.pair.otp}}
32-
elixir-version: ${{matrix.pair.elixir}}
33-
34-
- uses: actions/cache@v3
30+
- uses: actions/checkout@v4
31+
- uses: CargoSense/setup-elixir-project@v1
3532
with:
36-
path: deps
37-
key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }}-v1
38-
39-
- run: mix deps.get
40-
33+
otp-version: ${{ matrix.otp }}
34+
elixir-version: ${{ matrix.elixir }}
35+
build-flags: "--warnings-as-errors"
4136
- run: mix format --check-formatted
42-
if: ${{ matrix.lint }}
43-
44-
- run: mix deps.unlock --check-unused
45-
if: ${{ matrix.lint }}
46-
47-
- run: mix deps.compile
48-
49-
- run: mix compile --warnings-as-errors
50-
if: ${{ matrix.lint }}
51-
5237
- run: mix test
53-
if: ${{ ! matrix.lint }}
54-
55-
- run: mix test --warnings-as-errors
56-
if: ${{ matrix.lint }}

0 commit comments

Comments
 (0)