-
-
Notifications
You must be signed in to change notification settings - Fork 27
86 lines (73 loc) · 2.45 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
MIX_ENV: test
KUBECONFIG: /home/runner/.kube/config
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
k8s_version: [v1.27.3]
steps:
- uses: actions/[email protected]
- uses: engineerd/[email protected]
id: kind
with:
version: v0.17.0
image: kindest/node:${{ matrix.k8s_version }}
- name: Setup elixir
id: beam
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
install-rebar: true
install-hex: true
- name: Retrieve Build Cache
uses: actions/cache@v4
id: build-folder-cache
with:
path: _build
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v4
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Retrieve PLT Cache
uses: actions/cache@v4
id: plt-cache
with:
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
path: |
priv/plts
- name: Install Mix Dependencies
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Run Credo
run: mix credo --strict
- name: Run Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
MIX_ENV=test mix compile
MIX_ENV=test mix bonny.gen.manifest -o - | kubectl apply -f -
TEST_WAIT_TIMEOUT=10000 TEST_KUBECONFIG=$KUBECONFIG mix coveralls.github --include integration --timeout 12000
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer
- name: Run dialyzer
run: mix dialyzer --format github