-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (90 loc) · 3.01 KB
/
build.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
---
name: edtf
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
elixir:
- 1.15-25
- 1.15-26
- 1.16-25
- 1.16-26
- 1.17-25
- 1.17-26
- 1.17-27
env:
MIX_ENV: test
steps:
- name: Set Elixir and OTP versions
id: elixir-otp
run: |
echo "elixir=$(sed 's/-.*$//' <<< $version)" >> $GITHUB_OUTPUT
echo "otp=$(sed 's/^.*-//' <<< $version)" >> $GITHUB_OUTPUT
env:
version: ${{ matrix.elixir }}
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ steps.elixir-otp.outputs.otp }}
elixir-version: ${{ steps.elixir-otp.outputs.elixir }}
- name: Cache Elixir dependencies
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-
- name: Install Dependencies
run: mix do deps.get, deps.compile
- name: Static Analysis
run: mix credo --strict
env:
MIX_ENV: test
- name: Run Tests
run: mix test --trace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Pass all checks
run: echo "Tests passed"
coverage:
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- name: Set Elixir and OTP versions
id: elixir-otp
run: |
echo "elixir=$(sed 's/-.*$//' <<< $version)" >> $GITHUB_OUTPUT
echo "otp=$(sed 's/^.*-//' <<< $version)" >> $GITHUB_OUTPUT
env:
version: "1.17-27"
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ steps.elixir-otp.outputs.otp }}
elixir-version: ${{ steps.elixir-otp.outputs.elixir }}
- name: Cache Elixir dependencies
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-
- name: Install Dependencies
run: mix do deps.get, deps.compile
- name: Run Tests & Coverage Analysis
run: mix coveralls.github --trace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}