1
1
name : CI
2
2
3
- on :
3
+ on :
4
4
push :
5
+ branches : [ main ]
5
6
pull_request :
6
- release :
7
- types :
8
- - published
7
+ workflow_call :
9
8
10
9
jobs :
10
+ lint :
11
+ runs-on : ubuntu-latest
12
+ name : Linter
13
+ env :
14
+ MIX_ENV : test
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+ - uses : erlef/setup-beam@v1
18
+ with :
19
+ otp-version : 26.0
20
+ elixir-version : 1.15
21
+ - run : mix deps.get
22
+ - run : mix compile --warnings-as-errors
23
+ - run : mix credo --ignore design.tagtodo
24
+
11
25
test :
12
- # This ensures we run the test for only the PR or the push
13
- if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
14
26
services :
15
27
postgres :
16
28
image : postgres:latest
@@ -27,40 +39,25 @@ jobs:
27
39
--health-retries 5
28
40
strategy :
29
41
matrix :
30
- include :
42
+ version :
31
43
- otp : 26.0
32
44
elixir : 1.15.0
33
45
os : ubuntu-latest
34
46
- otp : 22.0
35
47
elixir : 1.12.0
36
48
# It's necessary to run on ubunto 20.04 for OTP 20 - 25
37
49
# See https://github.com/erlef/setup-beam
38
- os : ubuntu-20.04
39
- runs-on : ${{ matrix.os }}
40
- name : OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
41
- steps :
42
- - uses : actions/checkout@v3
43
- - uses : erlef/setup-beam@v1
44
- with :
45
- otp-version : ${{ matrix.otp }}
46
- elixir-version : ${{ matrix.elixir }}
47
- - run : mix deps.get
48
- - run : mix test
49
- env :
50
- POSTGRES_URL : ecto://postgres:postgres@localhost/pow_test
51
- - run : MIX_ENV=test mix credo --ignore design.tagtodo
52
- deploy :
53
- needs : test
54
- runs-on : ubuntu-latest
55
- if : github.event_name == 'release' && github.event.action == 'published'
56
- name : Deploy published release
50
+ os : ubuntu-20.04
51
+ runs-on : ${{ matrix.version.os }}
52
+ name : OTP ${{matrix.version.otp}} / Elixir ${{matrix.version.elixir}}
57
53
env :
58
- HEX_API_KEY : ${{ secrets.HEX_API_KEY }}
54
+ MIX_ENV : test
55
+ POSTGRES_URL : ecto://postgres:postgres@localhost/pow_test
59
56
steps :
60
57
- uses : actions/checkout@v3
61
58
- uses : erlef/setup-beam@v1
62
59
with :
63
- otp-version : 25.0
64
- elixir-version : 1.14.0
65
- - run : mix deps.get
66
- - run : mix hex.publish --yes
60
+ otp-version : ${{matrix.version.otp}}
61
+ elixir-version : ${{matrix.version.elixir}}
62
+ - run : mix deps.get mix compile --warnings-as-errors
63
+ - run : mix test
0 commit comments