Repository navigation
84 lines (80 loc) · 2.86 KB
/
Copy pathelixir.yml
File metadata and controls
84 lines (80 loc) · 2.86 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
name: Elixir CI
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- "*.md"
- ".github/workflows/releases.yml"
push:
branches:
- develop
paths-ignore:
- "*.md"
- ".github/workflows/releases.yml"
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- elixir: "1.15"
otp: "26"
check_formatting: false
- elixir: "1.18"
otp: "27"
check_formatting: false
- elixir: "1.19"
otp: "28"
check_formatting: true
# when updating this, please also see ./releases.yml
cache_version: ["4"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- name: Set up Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore dependencies cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
id: mix-cache
with:
path: deps
key: ${{matrix.cache_version}}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{matrix.cache_version}}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Check Formatting
if: matrix.check_formatting
run: mix format --check-formatted
- name: Credo
run: mix credo --strict
- name: Retrieve PLT Cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
id: plt_cache
with:
path: priv/plts
key: plt-${{matrix.cache_version}}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
plt-${{matrix.cache_version}}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
plt-${{matrix.cache_version}}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
path: |
priv/plts
- name: Run dialyzer
run: mix dialyzer --format github --format dialyxir
- name: Run tests
run: mix test