-
Notifications
You must be signed in to change notification settings - Fork 38
65 lines (52 loc) · 1.61 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 1 */1 *"
jobs:
test:
name: Elixir ${{ matrix.pair.elixir }} / OTP ${{ matrix.pair.otp }} / NATS ${{ matrix.pair.nats }}
runs-on: ubuntu-latest
strategy:
matrix:
pair:
- otp: "24.3.4"
elixir: "1.12"
nats: "2.10.0"
- otp: "26.2.4"
elixir: "1.16.2"
nats: "2.10.14"
- otp: "24.3.4"
elixir: "main"
nats: "latest"
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.pair.elixir }}
otp-version: ${{ matrix.pair.otp }}
- name: Start NATS Jetstream
run: docker run --rm -d --network host nats:${{ matrix.pair.nats }} -js
- name: Restore deps cache
uses: actions/cache@v2
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}
- name: Install package dependencies
run: mix deps.get
- name: Check for valid formatting
run: mix format --check-formatted
- name: Run unit tests
run: mix test --color