-
-
Notifications
You must be signed in to change notification settings - Fork 142
135 lines (111 loc) · 3.23 KB
/
test.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
check_duplicate_runs:
name: Check for duplicate runs
continue-on-error: true
runs-on: ubuntu-20.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
concurrent_skipping: always
cancel_others: true
skip_after_successful_duplicate: true
paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/LICENSE"]'
do_not_skip: '["pull_request"]'
test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-20.04
needs: check_duplicate_runs
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
elixir:
- '1.12.3'
- '1.13.4'
- '1.14.3'
- '1.15.7'
otp:
- '23.3'
- '24.3'
- '25.3'
- '26.1'
exclude:
- elixir: '1.12.3'
otp: '25.3'
- elixir: '1.12.3'
otp: '26.1'
- elixir: '1.13.4'
otp: '26.1'
- elixir: '1.14.3'
otp: '26.1'
- elixir: '1.15.7'
otp: '23.3'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install package dependencies
run: mix deps.get
- name: Remove compiled application files
run: mix clean
- name: Compile dependencies
run: mix compile
env:
MIX_ENV: test
- name: Run unit tests
run: mix test --trace
- name: Check compilation warnings
run: mix do compile --warnings-as-errors, archive.build, archive.install --force
env:
MIX_ENV: prod
- name: Check source code formatting
if: ${{ matrix.elixir > '1.15.0' }}
run: mix format --check-formatted
- name: Get results in short format
run: mix dialyzer --format short
env:
MIX_ENV: prod
- name: Get results in raw format
run: mix dialyzer --format raw
env:
MIX_ENV: prod
- name: Get results in dialyzer format
run: mix dialyzer --format dialyzer
env:
MIX_ENV: prod
- name: Get results in ignore_file format
run: mix dialyzer --format ignore_file
env:
MIX_ENV: prod
- name: Run output tests
run: mix test
env:
OUTPUT_TESTS: true
- name: Check examples
run: mix compile 2> /dev/null && mix dialyzer --format short --ignore-exit-status
env:
MIX_ENV: examples