-
Notifications
You must be signed in to change notification settings - Fork 6
113 lines (87 loc) · 2.92 KB
/
Copy pathci.yml
File metadata and controls
113 lines (87 loc) · 2.92 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: "1.18"
otp: "27"
- elixir: "1.19"
otp: "28"
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore dependencies cache
uses: actions/cache@v5
with:
path: deps
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
- name: Restore build cache
uses: actions/cache@v5
with:
path: _build
key: ${{ runner.os }}-build-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-build-${{ matrix.elixir }}-${{ matrix.otp }}-
- name: Install dependencies
run: mix deps.get
- name: Check lockfile is up to date
run: mix deps.get --check-unlocked
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
- name: Check formatting
run: mix format --check-formatted
- name: Compile (warnings as errors)
run: mix compile --warnings-as-errors
- name: Compile without optional dependencies
run: mix compile --force --warnings-as-errors --no-optional-deps
- name: Check for compile-time dependency cycles
run: mix xref graph --format cycles --label compile-connected --fail-above 0
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Build preview assets
run: npm run build
- name: Run tests
run: epmd -daemon && mix test
dialyzer:
name: Dialyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
elixir-version: "1.18"
otp-version: "27"
- name: Restore dependencies cache
uses: actions/cache@v5
with:
path: deps
key: ${{ runner.os }}-mix-dialyzer-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-dialyzer-
- name: Restore build and PLT cache
uses: actions/cache@v5
with:
path: _build
key: ${{ runner.os }}-build-dialyzer-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-build-dialyzer-
- name: Install dependencies
run: mix deps.get
- name: Create PLTs
run: mix dialyzer --plt
- name: Run Dialyzer
run: mix dialyzer --format github