-
Notifications
You must be signed in to change notification settings - Fork 182
99 lines (86 loc) · 2.54 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test
on:
push:
pull_request:
branches:
- master
jobs:
check_duplicate_runs:
name: Check for duplicate runs
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
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:
include:
- elixir: 1.7
otp: 21.3
- elixir: 1.8.2
otp: 21.3
- elixir: 1.9.4
otp: 22.2
- elixir: 1.10.4
otp: 23.0
- elixir: 1.13.0
otp: 24.1
- elixir: 1.14.1
otp: 25.1
check_warnings: true
check_format: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Set up Redis Server
run: sudo apt-get install redis-server -y
- 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: Check Format
run: mix format --check-formatted
if: ${{ matrix.check_format }}
- name: Compile dependencies
run: mix compile
env:
MIX_ENV: test
- name: Check warnings
run: mix compile --force --warnings-as-errors
if: ${{ matrix.check_warnings }}
env:
MIX_ENV: test
- name: Run unit tests
run: mix coveralls.github --no-start
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}