-
-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (70 loc) · 1.82 KB
/
ci_core.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
on:
push:
branches:
- main
paths:
- core/**
pull_request:
branches:
- main
paths:
- core/**
env:
MIX_ENV: test
permissions:
contents: read
jobs:
ci:
runs-on: ubuntu-latest
services:
db:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: canary_test
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: core
- uses: arduino/setup-task@v2
- uses: erlef/setup-beam@v1
with:
version-file: core/.tool-versions
version-type: strict
- uses: actions/cache@v3
id: cache-deps
env:
cache-name: cache-elixir-deps
with:
path: core/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- uses: actions/cache@v3
id: cache-build
env:
cache-name: cache-compiled-build
with:
path: core/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
- if: github.run_attempt != '1'
run: |
mix deps.clean --all
mix clean
shell: sh
- run: mix deps.get
working-directory: core
- run: mix compile --warnings-as-errors
working-directory: core
- run: mix format --check-formatted
working-directory: core
- run: mix test
working-directory: core