-
-
Notifications
You must be signed in to change notification settings - Fork 75
80 lines (66 loc) 路 1.98 KB
/
Copy pathmain.yml
File metadata and controls
80 lines (66 loc) 路 1.98 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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} | Erlang/OTP ${{ matrix.otp }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- otp: "29.0"
elixir: "1.20"
os: ubuntu-24.04
lint: true
coverage: true
dialyzer: true
# Technically supports down to OTP 23 (as that's what Elixir 1.14 supports),
# but on CI it's easier to use OTP 24.
- otp: "24.3"
elixir: "1.14"
os: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
steps:
- name: Clone repository
uses: actions/checkout@v7
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
version-type: strict
- name: Install dependencies
run: mix deps.get --only test
- name: Check for formatted code
if: ${{ matrix.lint }}
run: mix format --check-formatted
- name: Cache/uncache PLTs
uses: actions/cache@v6
with:
path: |
priv/plts
key: "${{ runner.os }}-\
erlang-${{ matrix.otp }}-\
elixir-${{ matrix.elixir }}-\
${{ hashFiles('mix.lock') }}"
- name: Run Dialyzer
if: ${{ matrix.dialyzer }}
run: mix dialyzer
- name: Check for unused/unlocked dependencies
if: ${{ matrix.lint }}
run: mix do deps.get + deps.unlock --check-unused + deps.get --check-locked
- name: Check for compilation warnings
if: ${{ matrix.lint }}
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github
if: ${{ matrix.coverage }}