Skip to content

Commit b71f5c9

Browse files
committed
Cleans up CI and looser Elixir version requirement
1 parent cf9d416 commit b71f5c9

2 files changed

Lines changed: 45 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,66 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
branches: [main]
78

89
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' || '' }})
1112
runs-on: ubuntu-latest
13+
1214
strategy:
1315
fail-fast: false
1416
matrix:
1517
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
1724
- elixir: "1.19.5"
1825
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+
2331
steps:
24-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v6
2533

2634
- uses: erlef/setup-beam@v1
2735
with:
28-
otp-version: ${{ matrix.otp }}
2936
elixir-version: ${{ matrix.elixir }}
37+
otp-version: ${{ matrix.otp }}
3038

31-
- name: Cache deps and build
32-
uses: actions/cache@v4
39+
- uses: actions/cache@v5
3340
with:
3441
path: |
3542
deps
3643
_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

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule HRW.MixProject do
55
[
66
app: :hrw,
77
version: "0.2.0",
8-
elixir: "~> 1.18",
8+
elixir: "~> 1.15",
99
start_permanent: Mix.env() == :prod,
1010
aliases: aliases(),
1111
deps: deps(),

0 commit comments

Comments
 (0)