-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (67 loc) · 2.21 KB
/
elixir.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build and Check Elixir
on:
pull_request:
branches: ["main"]
permissions:
contents: read
env:
MIX_ENV: dev
OTP: "26.2.2"
ELIXIR: "1.16.1"
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/[email protected]
with:
elixir-version: ${{ env.ELIXIR }}
otp-version: ${{ env.OTP }}
- name: Restore dependencies cache
uses: actions/cache@v4
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-
- name: Install dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix deps.get --only dev
mix deps.get --only test
- name: Restore build cache
uses: actions/cache@v4
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-
- name: Build dependencies
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
MIX_ENV=dev mix do deps.compile, compile
MIX_ENV=test mix do deps.compile, compile
- name: Check format
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run tests
run: MIX_ENV=test mix test
- name: Retrieve PLT Cache
uses: actions/cache@v4
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-plts-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-plts-
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --no-check --halt-exit-status
- name: SAST with sobelow
run: mix sobelow --config .sobelow-conf