-
Notifications
You must be signed in to change notification settings - Fork 87
64 lines (52 loc) · 1.46 KB
/
main.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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} | Erlang/OTP ${{ matrix.erlang }})
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
erlang: "27.0"
elixir: "1.17"
lint: true
coverage: true
- os: ubuntu-20.04
erlang: "24.1"
elixir: "1.13"
- os: ubuntu-20.04
erlang: "23.3"
elixir: "1.12"
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- name: Install dependencies
run: mix deps.get --check-locked
- name: Check no unused dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Check formatting
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Compile with --warnings-as-errors
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- name: Run tests
run: mix test --trace
if: ${{ !matrix.coverage }}
- name: Run tests with code coverage
run: mix coveralls.github
if: ${{ matrix.coverage }}