-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (87 loc) · 3.56 KB
/
build-and-test.yml
File metadata and controls
108 lines (87 loc) · 3.56 KB
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
name: build and test
on: push
jobs:
build-and-test:
name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest] # macOS-latest is not supported by erlef/setup-beam@v1 right now
steps:
# On the Windows runner, the line ending conversions are enabled
- name: Disable Git line ending conversions
run: git config --global core.autocrlf false
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Erlang/OTP, Elixir, and Hex
uses: erlef/setup-beam@v1
id: beam
with:
otp-version: "25.0.1"
elixir-version: "1.13.4"
version-type: strict
install-hex: true
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
- name: Restore PLT cache
uses: actions/cache@v3
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
##################################################
#### IslandsEngine project #######################
##################################################
- name: "IslandsEngine: Install dependencies"
run: mix deps.get
working-directory: islands_engine
- name: "IslandsEngine: Compile"
run: mix compile --warnings-as-errors
working-directory: islands_engine
- name: "IslandsEngine: Run tests"
run: mix test --warnings-as-errors
working-directory: islands_engine
- name: "IslandsEngine: Check formatting"
run: mix format --check-formatted
working-directory: islands_engine
- name: "IslandsEngine: Run Credo checks"
run: mix credo
working-directory: islands_engine
# Create PLTs if no cache is found
- name: "IslandsEngine: Create PLTs"
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
working-directory: islands_engine
- name: "IslandsEngine: Run Dialyzer"
run: mix dialyzer
working-directory: islands_engine
##################################################
#### IslandsInterface project ####################
##################################################
- name: "IslandsInterface: Install dependencies"
run: mix deps.get
working-directory: islands_interface
- name: "IslandsInterface: Compile"
run: mix compile --warnings-as-errors
working-directory: islands_interface
- name: "IslandsInterface: Run tests"
run: mix test --warnings-as-errors
working-directory: islands_interface
- name: "IslandsInterface: Check formatting"
run: mix format --check-formatted
working-directory: islands_interface
- name: "IslandsInterface: Run Credo checks"
run: mix credo
working-directory: islands_interface
# Create PLTs if no cache is found
- name: "IslandsInterface: Create PLTs"
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
working-directory: islands_interface
- name: "IslandsInterface: Run Dialyzer"
run: mix dialyzer
working-directory: islands_interface