-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (68 loc) · 2.38 KB
/
checks.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
name: Checks
on: push
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
jobs:
checks:
runs-on: ubuntu-latest
services:
db:
image: postgres:14
ports: ["5432:5432"]
env:
POSTGRES_USER: turbo
POSTGRES_PASSWORD: turbo
POSTGRES_DB: turbo_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read tooling version from .tool-versions
id: tool-versions
run: |
ERLANG_VERSION_FROM_FILE=$(awk 'NR==1{print $2}' .tool-versions)
ELIXIR_VERSION_FROM_FILE=$(awk 'NR==2' .tool-versions | awk 'NR==1{print $2}')
echo "Erlang version: ${ERLANG_VERSION_FROM_FILE}"
echo "Elixir version: ${ELIXIR_VERSION_FROM_FILE}"
echo "erlang=$ERLANG_VERSION_FROM_FILE" >> "$GITHUB_OUTPUT"
echo "elixir=$ELIXIR_VERSION_FROM_FILE" >> "$GITHUB_OUTPUT"
- name: Setup Elixir
uses: erlef/setup-beam@v1
id: beam
with:
otp-version: ${{ steps.tool-versions.outputs.erlang }}
elixir-version: ${{ steps.tool-versions.outputs.elixir }}
- name: Fetch cached dependencies
uses: actions/cache@v3
id: mix-cache
with:
path: |
deps
_build
priv/plts
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ hashFiles('mix.lock') }}
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}
- name: Install dependencies
run: mix deps.get
- name: Dialyzer
run: mix dialyzer
# Create PLTs for dialyzer checks
- name: Create PLTs
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Code format
run: mix format --check-formatted
- name: Unused dependencies
run: mix deps.unlock --check-unused
- name: Compile
run: mix compile --warnings-as-errors
- name: Tests
run: mix test --trace --color