-
Notifications
You must be signed in to change notification settings - Fork 174
151 lines (139 loc) · 4.95 KB
/
components_electric_tests.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Components / Electric / Tests
on:
push:
branches:
- main
pull_request:
paths:
- "components/electric/**"
- "!components/electric/**README.md"
env:
OTP_VERSION: "25.3"
ELIXIR_VERSION: "1.15"
concurrency:
group: components-electric-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: elixir tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
restore-keys: ${{ runner.os }}-mixdeps-
- name: Restore compiled code
uses: actions/cache/restore@v3
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
- run: mix deps.get && mix deps.compile
- name: Cache dependencies
uses: actions/cache/save@v3
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
- name: Save compiled code
uses: actions/cache/save@v3
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-test-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
- run: mix compile --force --all-warnings --warnings-as-errors
- name: Prepare auxiliary services
run: make start_dev_env
- run: mix test
formatting:
name: formatting
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
- run: mix deps.get
- run: make check-format
dialyzer:
name: dialyzer
runs-on: ubuntu-latest
defaults:
run:
working-directory: components/electric
env:
MIX_ENV: dev
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: components/electric/deps
key: ${{ runner.os }}-mixdeps-${{ hashFiles('components/electric/**/mix.lock') }}
- name: Restore compiled code
uses: actions/cache/restore@v3
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
- run: mix deps.get && mix deps.compile
- name: Save compiled code
uses: actions/cache/save@v3
with:
path: |
components/electric/_build/*/lib
!components/electric/_build/*/lib/electric
key: ${{ runner.os }}-mixbuild-dev-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('components/electric/**/mix.lock') }}
- run: mix compile --force --all-warnings --warnings-as-errors
- name: Cache PLT
uses: actions/cache/restore@v3
with:
path: components/electric/_build/*/*.plt
key: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ github.ref_name }}
restore-keys: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-
- run: mix dialyzer
id: dialyzer
- name: Cache PLT
if: ${{ always() && steps.dialyzer.outcome != 'cancelled' }}
uses: actions/cache/save@v3
with:
path: components/electric/_build/*/*.plt
key: ${{ runner.os }}-plt-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ github.ref_name }}