-
Notifications
You must be signed in to change notification settings - Fork 345
133 lines (129 loc) · 4.14 KB
/
test.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
name: Test
on: [pull_request]
jobs:
Test:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- elixir: '1.15.8'
otp: '25.3.2.12'
experimental: false
lint: false
- elixir: '1.16.3'
otp: '26.2.5'
experimental: false
lint: true
- elixir: '1.17.1'
otp: '27.0'
experimental: false
lint: false
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
id: cache
with:
path: deps
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
MIX_ENV: test
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests
run: mix test --trace
- if: ${{ matrix.lint }}
name: Check Format
run: mix format --check-formatted
# This tests with Gun 1, where as the standard Test job tests Gun 2
Test-gun1:
runs-on: ubuntu-latest
name: Gun 1
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.15.8'
otp-version: '25.3.2.12'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
id: cache
with:
path: deps
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-gun-${{ hashFiles('test/lockfiles/gun1.lock') }}
restore-keys: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-gun-
- name: Install Dependencies
env:
MIX_ENV: test
LOCKFILE: gun1
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests
env:
LOCKFILE: gun1
run: mix test test/tesla/adapter/gun_test.exs --trace
dialyzer:
runs-on: ubuntu-latest
name: Dialyzer
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.16.3'
otp-version: '26.2.5'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
id: cache
with:
path: |
deps
_build
dialyzer
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-dialyzer-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-dialyzer-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
MIX_ENV: test
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
# Doesn't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
# Cache key based on Elixir & Erlang version.
- name: Restore PLT cache
uses: actions/cache@v4
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
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --format github