-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (73 loc) · 2.15 KB
/
main.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
name: CI
on:
push:
branches: [ main ]
pull_request:
env:
POSTGRES_DB: epiviewpoint_test
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
jobs:
test:
runs-on: ubuntu-latest
env:
MIX_ENV: test
strategy:
matrix:
postgres-version: [16.4-alpine]
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1
id: beam
with:
version-file: .tool-versions
version-type: strict
- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
- name: Restore the deps and _build cache
uses: actions/cache@v4
id: restore-cache
env:
OTP_VERSION: ${{ steps.beam.outputs.otp-version }}
ELIXIR_VERSION: ${{ steps.beam.outputs.elixir-version }}
MIX_LOCK_HASH: ${{ hashFiles('**/mix.lock') }}
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-mixlockhash-${{ env.MIX_LOCK_HASH }}
- name: Install mix dependencies
if: steps.restore-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: audit
run: |
mix deps.unlock --check-unused
mix deps.audit
mix sobelow --config
- name: Run mix format
run: mix format --check-formatted
- name: Run tests
run: bin/dev/test
env:
CANONICAL_HOST: localhost
LIVE_VIEW_SIGNING_SALT: mZT0Lo72e+U9KLtsTQzdKmmxpda0uuJJlMWTzJYdFBhddwbGbAC3h5T1QusYBhBr
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
SECRET_KEY_BASE: iuJS3FLMrRqbKug/CE4zGGd31eY6FMdmpQGjy8RMaQoxk59wAvSxuUKM6c/uaOo4