-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.19 KB
/
Copy pathprecommit.yml
File metadata and controls
48 lines (37 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Precommit
on:
push:
branches: [main]
pull_request:
env:
MIX_ENV: test
jobs:
check:
name: compile, format & credo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
version-file: mise.toml
version-type: strict
- name: Restore deps cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('mise.toml') }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('mise.toml') }}-
- name: Check lockfile is up to date
run: mix deps.get --check-locked
- name: Check unused deps
run: mix deps.unlock --unused && git diff --exit-code mix.lock
- name: Compile (warnings as errors)
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Credo
run: mix credo --strict