-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (76 loc) · 2.5 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: CI
on:
pull_request:
push:
branches:
- main
jobs:
mix_test:
name: mix test (${{format(matrix.blend != '' && 'Blend {0} | Elixir {1} | Erlang/OTP {1}' || 'Elixir {1} | Erlang/OTP {2}', matrix.blend, matrix.elixir, matrix.otp)}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.13.4'
otp: '24.0'
blend: 'phoenix_live_view_0_19_0'
- elixir: '1.13.4'
otp: '25.0'
- elixir: '1.14.0'
otp: '25.0'
- elixir: '1.15.2'
otp: '26.0'
- elixir: '1.16.0'
otp: '26.2.1'
- elixir: '1.17.0'
otp: '27.0.1'
check_formatted: true
warnings_as_errors: true
env:
MIX_ENV: test
BLEND: ${{ matrix.blend }}
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
env:
BLEND: ''
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Deps and _build cache
if: ${{ !matrix.blend }}
uses: actions/cache@v4
id: deps-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- name: Blend deps and _build cache
if: matrix.blend
uses: actions/cache@v4
id: blend-deps-cache
with:
path: |
blend/_build/${{matrix.blend}}
blend/deps/${{matrix.blend}}
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('blend/{0}.mix.lock', matrix.blend)) }}
- name: Install Dependencies
if: steps.deps-cache.outputs.cache-hit != 'true' || steps.blend-deps-cache.outputs.cache-hit != 'true'
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get --only test
- run: mix deps.compile
if: steps.deps-cache.outputs.cache-hit != 'true' || steps.blend-deps-cache.outputs.cache-hit != 'true'
- run: mix format --check-formatted
if: matrix.check_formatted
- run: mix compile
if: ${{ !matrix.warnings_as_errors }}
- run: mix compile --warnings-as-errors
if: matrix.warnings_as_errors
- run: mix test
if: ${{ !matrix.warnings_as_errors }}
- run: mix test --warnings-as-errors
if: matrix.warnings_as_errors