-
-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (44 loc) · 1.46 KB
/
code_quality.yaml
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
49
50
51
52
53
54
name: Code Quality
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
MIX_ENV: test
jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup elixir
id: beam
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
install-rebar: true
install-hex: true
- name: Retrieve Build Cache
uses: actions/cache@v4
id: build-folder-cache
with:
path: _build/test
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-build-test-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v4
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile
run: MIX_ENV=test mix compile --warnings-as-errors
- name: Unit Tests
run: MIX_ENV=test mix test
- name: Run Credo
run: MIX_ENV=test mix credo --strict