|
4 | 4 | push: |
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
| 7 | + branches: [main] |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - ci: |
10 | | - name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} |
| 10 | + test: |
| 11 | + name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}${{ matrix.unlock && ' / unlock' || '' }}) |
11 | 12 | runs-on: ubuntu-latest |
| 13 | + |
12 | 14 | strategy: |
13 | 15 | fail-fast: false |
14 | 16 | matrix: |
15 | 17 | include: |
16 | | - # Latest, matches mise.toml. |
| 18 | + - elixir: "1.15.0" |
| 19 | + otp: "24.3" |
| 20 | + unlock: false |
| 21 | + - elixir: "1.19.5" |
| 22 | + otp: "28.5" |
| 23 | + unlock: false |
17 | 24 | - elixir: "1.19.5" |
18 | 25 | otp: "28.5" |
19 | | - # Floor of `elixir: "~> 1.18"`. Catches accidental use of features |
20 | | - # only present in newer Elixir/OTP releases. |
21 | | - - elixir: "1.18.0" |
22 | | - otp: "25.3" |
| 26 | + unlock: true |
| 27 | + |
| 28 | + env: |
| 29 | + MIX_ENV: test |
| 30 | + |
23 | 31 | steps: |
24 | | - - uses: actions/checkout@v4 |
| 32 | + - uses: actions/checkout@v6 |
25 | 33 |
|
26 | 34 | - uses: erlef/setup-beam@v1 |
27 | 35 | with: |
28 | | - otp-version: ${{ matrix.otp }} |
29 | 36 | elixir-version: ${{ matrix.elixir }} |
| 37 | + otp-version: ${{ matrix.otp }} |
30 | 38 |
|
31 | | - - name: Cache deps and build |
32 | | - uses: actions/cache@v4 |
| 39 | + - uses: actions/cache@v5 |
33 | 40 | with: |
34 | 41 | path: | |
35 | 42 | deps |
36 | 43 | _build |
37 | | - key: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} |
38 | | - restore-keys: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}-mix- |
39 | | - |
40 | | - - run: mix deps.get |
41 | | - - run: mix format --check-formatted |
42 | | - - run: mix compile --warnings-as-errors |
43 | | - - run: mix test |
44 | | - - run: mix credo --strict |
| 44 | + key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} |
| 45 | + restore-keys: | |
| 46 | + ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}- |
| 47 | +
|
| 48 | + - name: Check formatting |
| 49 | + run: mix format --check-formatted |
| 50 | + |
| 51 | + - name: Unlock deps |
| 52 | + if: matrix.unlock |
| 53 | + run: mix deps.unlock --all |
| 54 | + |
| 55 | + - name: Check for unused deps in mix.lock |
| 56 | + if: '!matrix.unlock' |
| 57 | + run: mix deps.unlock --check-unused |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + run: mix deps.get |
| 61 | + |
| 62 | + - name: Compile with warnings as errors |
| 63 | + run: mix compile --warnings-as-errors |
| 64 | + |
| 65 | + - name: Run Credo |
| 66 | + run: mix credo --strict |
| 67 | + |
| 68 | + - name: Run tests |
| 69 | + run: mix test |
0 commit comments