-
Notifications
You must be signed in to change notification settings - Fork 41
78 lines (75 loc) · 2.09 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
name: Elixir
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
# required by test reporter
pull-requests: write
checks: write
issues: write
statuses: write
strategy:
matrix:
include:
- otp-version: 21.3
elixir-version: 1.7.0
- otp-version: 22.2
elixir-version: 1.9.4
- otp-version: 23.2
elixir-version: 1.10.4
- otp-version: 24.3
elixir-version: 1.13.4
- otp-version: 25.0
elixir-version: 1.14.0
check-formatted: true
report-coverage: true
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: deps-${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-elixir-${{ matrix.elixir-version }}-otp-${{ matrix.otp-version }}
- name: Install and compile dependencies
env:
MIX_ENV: test
run: mix do deps.get, deps.compile
- name: Make sure code is formatted
env:
MIX_ENV: test
if: ${{ matrix.check-formatted == true }}
run: mix format --check-formatted
- name: Run tests
env:
MIX_ENV: test
run: mix test --exclude pending
- name: Test Report
env:
MIX_ENV: test
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Mix Tests on Elixir ${{ matrix.elixir-version }} / OTP ${{ matrix.otp-version }}
path: _build/test/lib/sage/test-junit-report.xml
reporter: java-junit
- name: Report code coverage
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.report-coverage == true }}
run: mix coveralls.github