-
Notifications
You must be signed in to change notification settings - Fork 80
106 lines (100 loc) · 2.87 KB
/
v3.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
name: Torch v3 CI
on:
pull_request:
branches: [v1, v2, v3]
types: [opened, edited, reopened, synchronize]
push:
branches: [v3]
tags:
- v[1-3].[0-9]+.[0-9]+
jobs:
mix_test:
name: mix test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.10.x
otp: 21.3.8.21
- elixir: 1.10.x
otp: 22.3.4.16
- elixir: 1.10.x
otp: 23.2.7
warnings_as_errors: true
static_analysis: false
- elixir: 1.11.x
otp: 21.3.8.21
- elixir: 1.11.x
otp: 22.3.4.16
- elixir: 1.11.x
otp: 23.2.7
warnings_as_errors: true
static_analysis: false
- elixir: 1.12.x
otp: 22.x
- elixir: 1.12.x
otp: 23.x
- elixir: 1.12.x
otp: 24.x
services:
db:
image: postgres:10.1-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: example_test
POSTGRES_PASSWORD: ""
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MIX_ENV: test
DATABASE_POSTGRESQL_USERNAME: postgres
PGHOST: postgres
PGUSER: postgres
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
cache: 'npm'
cache-dependency-path: assets/package-lock.json
- uses: erlef/setup-elixir@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Get Deps cache
uses: actions/cache@v4
with:
path: deps/
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
- name: Get BUILD cache
uses: actions/cache@v4
with:
path: _build/test/
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
$HOME/.hex
$HOME/.mix
key: artifacts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
- name: Install Deps
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get --only test
- run: mix compile --warnings-as-errors
if: matrix.warnings_as_errors
- name: Run tests
run: bin/setup
- name: coveralls
run: mix coveralls.github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mix dialyzer --halt-exist-status
if: matrix.static_analysis