-
Notifications
You must be signed in to change notification settings - Fork 15
80 lines (80 loc) · 2.96 KB
/
ci.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
# Created with GitHubActions version 0.3.0
name: CI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
- pull_request
- push
jobs:
linux:
name: Test on Ubuntu (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.18.1'
otp: '27.2'
- elixir: '1.18.1'
otp: '26.2'
- elixir: '1.18.1'
otp: '25.3'
- elixir: '1.17.3'
otp: '25.3'
- elixir: '1.16.3'
otp: '24.3'
- elixir: '1.15.8'
otp: '24.3'
- elixir: '1.14.5'
otp: '23.3'
- elixir: '1.13.4'
otp: '22.3'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir
id: setup-beam
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps
uses: actions/cache@v4
with:
path: deps
key: deps-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ steps.setup-beam.outputs.setup-beam-version }}
- name: Restore _build
uses: actions/cache@v4
with:
path: _build
key: _build-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ steps.setup-beam.outputs.setup-beam-version }}
- name: Restore test/support/plts
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
uses: actions/cache@v4
with:
path: test/support/plts
key: test/support/plts-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ steps.setup-beam.outputs.setup-beam-version }}
- name: Get dependencies
run: mix deps.get
- name: Compile dependencies
run: MIX_ENV=test mix deps.compile
- name: Compile project
run: MIX_ENV=test mix compile --warnings-as-errors
- name: Check unused dependencies
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
run: mix deps.unlock --check-unused
- name: Check code format
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
run: mix format --check-formatted
- name: Lint code
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
run: mix credo --strict
- name: Run tests
if: ${{ !(matrix.elixir == '1.18.1' && matrix.otp == '27.2') }}
run: mix test
- name: Run tests with coverage
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
run: mix coveralls.github
- name: Static code analysis
if: ${{ matrix.elixir == '1.18.1' && matrix.otp == '27.2' }}
run: mix dialyzer --format github --force-check