-
Notifications
You must be signed in to change notification settings - Fork 28
144 lines (141 loc) · 4.66 KB
/
elixir.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Elixir CI
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
env:
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
BRANCH: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.event.pull_request.head.ref) || github.ref }}
jobs:
test:
# This condition ensures that this job will not run on pull requests in draft state
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
otp: [22, 23, 24, 25, 26]
elixir: [1.12, 1.13, 1.14, 1.15, 1.16.0-rc.0]
exclude:
- otp: 26
elixir: 1.14
- otp: 26
elixir: 1.13
- otp: 26
elixir: 1.12
- otp: 25
elixir: 1.12
- otp: 23
elixir: 1.16.0-rc.0
- otp: 23
elixir: 1.15
- otp: 22
elixir: 1.16.0-rc.0
- otp: 22
elixir: 1.15
- otp: 22
elixir: 1.14
- otp: 26
os: ubuntu-20.04
- otp: 25
os: ubuntu-20.04
- otp: 24
os: ubuntu-20.04
- otp: 23
os: ubuntu-22.04
- otp: 22
os: ubuntu-22.04
runs-on: ${{matrix.os}}
name: test|OTP ${{matrix.otp}}|Elixir ${{matrix.elixir}}|${{matrix.os}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{env.BRANCH}}
- uses: erlef/[email protected]
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Disable compile warnings
run: echo "::remove-matcher owner=elixir-mixCompileWarning::"
- name: Retrieve mix dependencies cache
uses: actions/cache@v3
id: mix-cache
with:
path: |
deps
_build
key: test-${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: test-${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix deps.get
mix deps.compile
- name: Compile project
run: mix compile
- name: Compile project (:test)
run: MIX_ENV=test mix compile
- name: Compile project (:property)
run: MIX_ENV=property mix compile
- name: Run property-based tests
run: mix test.property --cover --export-coverage property-coverage
- name: Run tests
run: mix coveralls.github --import-cover cover
lint:
# This condition ensures that this job will not run on pull requests in draft state
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-22.04
name: lint|OTP 26|Elixir 1.15|ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{env.BRANCH}}
- uses: erlef/[email protected]
with:
otp-version: 26
elixir-version: 1.15
- name: Disable compile warnings
run: echo "::remove-matcher owner=elixir-mixCompileWarning::"
- name: Retrieve mix dependencies cache
uses: actions/cache@v3
id: mix-cache
with:
path: |
deps
_build
key: test-ubuntu-22.04-26-1.15-${{ hashFiles('**/mix.lock') }}
restore-keys: test-ubuntu-22.04-26-1.15-
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix deps.get
mix deps.compile
- name: Compile project
run: mix compile --warnings-as-errors
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
- name: Check formatting
run: mix format --check-formatted
- name: Check style
run: mix credo --strict
- name: Check compilation cycles
run: mix xref graph --format cycles --fail-above 0
- name: Check unused code
run: mix compile.unused --severity warning --warnings-as-errors
- name: Retrieve PLT cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ubuntu-22.04-26-1.15-plts-${{ hashFiles('**/mix.lock') }}
restore-keys: ubuntu-22.04-26-1.15-plts-
- name: Create PLTs
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --format github