Skip to content

Commit c6b2076

Browse files
committed
update ci
1 parent aa09176 commit c6b2076

File tree

2 files changed

+194
-105
lines changed

2 files changed

+194
-105
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -9,174 +9,177 @@ on:
99
- master
1010

1111
jobs:
12-
mix_test:
13-
name: mix test (Elixir ${{matrix.elixir}} | Erlang/OTP ${{matrix.otp}})
12+
# Quick smoke test with latest versions
13+
smoke_test:
14+
name: Smoke test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
1415
runs-on: ubuntu-22.04
16+
strategy:
17+
matrix:
18+
include:
19+
- elixir: 1.18.x
20+
otp: 27.x
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: erlef/setup-beam@v1
24+
with:
25+
otp-version: ${{matrix.otp}}
26+
elixir-version: ${{matrix.elixir}}
27+
- name: Cache dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
_build
32+
deps
33+
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
36+
- name: Install Dependencies
37+
run: |
38+
mix local.hex --force
39+
mix local.rebar --force
40+
mix deps.get --only test
41+
- run: mix test
42+
43+
# Core compatibility matrix - test minimum, LTS, and latest versions
44+
compatibility_test:
45+
name: Compatibility test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}} | ${{matrix.os}})
46+
runs-on: ${{matrix.os}}
47+
needs: smoke_test # Only run if smoke test passes
1548
strategy:
1649
fail-fast: false
1750
matrix:
1851
include:
19-
# No installer available on ubuntu-22.04
20-
# - elixir: 1.14.x
21-
# otp: 23.x
22-
# tests_may_fail: false
52+
# Minimum supported versions
2353
- elixir: 1.14.x
2454
otp: 24.x
25-
tests_may_fail: false
26-
- elixir: 1.14.x
27-
otp: 25.x
28-
tests_may_fail: false
55+
os: ubuntu-22.04
2956
- elixir: 1.14.x
30-
otp: 26.x
31-
tests_may_fail: false
32-
- elixir: 1.15.x
33-
otp: 24.x
34-
tests_may_fail: false
35-
- elixir: 1.15.x
36-
otp: 25.x
37-
tests_may_fail: false
38-
- elixir: 1.15.x
39-
otp: 26.x
40-
tests_may_fail: false
41-
- elixir: 1.16.x
4257
otp: 24.x
43-
tests_may_fail: false
44-
- elixir: 1.16.x
45-
otp: 25.x
46-
tests_may_fail: false
58+
os: windows-2022
59+
# Middle versions
4760
- elixir: 1.16.x
4861
otp: 26.x
49-
tests_may_fail: false
50-
- elixir: 1.17.x
51-
otp: 25.x
52-
tests_may_fail: false
53-
- elixir: 1.17.x
62+
os: ubuntu-22.04
63+
- elixir: 1.16.x
5464
otp: 26.x
55-
tests_may_fail: false
56-
- elixir: 1.17.x
57-
otp: 27.x
58-
tests_may_fail: false
59-
- elixir: 1.18.x
60-
otp: 25.x
61-
tests_may_fail: false
65+
os: windows-2022
66+
# Latest versions
6267
- elixir: 1.18.x
63-
otp: 26.x
64-
tests_may_fail: false
68+
otp: 27.x
69+
os: ubuntu-22.04
6570
- elixir: 1.18.x
6671
otp: 27.x
67-
tests_may_fail: false
72+
os: windows-2022
6873
env:
6974
MIX_ENV: test
7075
steps:
76+
- name: Set git to use original line ending (Windows)
77+
if: runner.os == 'Windows'
78+
run: git config --global core.autocrlf false
7179
- uses: actions/checkout@v4
7280
- uses: erlef/setup-beam@v1
7381
with:
7482
otp-version: ${{matrix.otp}}
7583
elixir-version: ${{matrix.elixir}}
84+
- name: Cache dependencies
85+
uses: actions/cache@v4
86+
with:
87+
path: |
88+
_build
89+
deps
90+
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
91+
restore-keys: |
92+
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
7693
- name: Install Dependencies
7794
run: |
7895
mix local.hex --force
7996
mix local.rebar --force
8097
mix deps.get --only test
8198
- run: mix test
82-
continue-on-error: ${{ matrix.tests_may_fail }}
8399

84-
mix_test_windows:
85-
name: mix test windows (Elixir ${{matrix.elixir}} | Erlang/OTP ${{matrix.otp}})
86-
runs-on: windows-2022
100+
# Comprehensive matrix - only run on master branch or when specifically requested
101+
comprehensive_test:
102+
name: Comprehensive test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
103+
runs-on: ubuntu-22.04
104+
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'comprehensive-tests')
87105
strategy:
88106
fail-fast: false
89107
matrix:
90108
include:
91-
- elixir: 1.14.x
92-
otp: 23.x
93-
tests_may_fail: false
94109
- elixir: 1.14.x
95110
otp: 24.x
96-
tests_may_fail: false
97111
- elixir: 1.14.x
98112
otp: 25.x
99-
tests_may_fail: false
100113
- elixir: 1.14.x
101114
otp: 26.x
102-
tests_may_fail: false
103115
- elixir: 1.15.x
104116
otp: 24.x
105-
tests_may_fail: false
106117
- elixir: 1.15.x
107118
otp: 25.x
108-
tests_may_fail: false
109119
- elixir: 1.15.x
110120
otp: 26.x
111-
tests_may_fail: false
112121
- elixir: 1.16.x
113122
otp: 24.x
114-
tests_may_fail: false
115123
- elixir: 1.16.x
116124
otp: 25.x
117-
tests_may_fail: false
118125
- elixir: 1.16.x
119126
otp: 26.x
120-
tests_may_fail: false
121127
- elixir: 1.17.x
122128
otp: 25.x
123-
tests_may_fail: false
124129
- elixir: 1.17.x
125130
otp: 26.x
126-
tests_may_fail: false
127131
- elixir: 1.17.x
128132
otp: 27.x
129-
tests_may_fail: false
130133
- elixir: 1.18.x
131134
otp: 25.x
132-
tests_may_fail: false
133135
- elixir: 1.18.x
134136
otp: 26.x
135-
tests_may_fail: false
136137
- elixir: 1.18.x
137138
otp: 27.x
138-
tests_may_fail: false
139139
env:
140140
MIX_ENV: test
141141
steps:
142-
- name: Set git to use original line ending
143-
run: |
144-
git config --global core.autocrlf false
145142
- uses: actions/checkout@v4
146143
- uses: erlef/setup-beam@v1
147144
with:
148145
otp-version: ${{matrix.otp}}
149146
elixir-version: ${{matrix.elixir}}
147+
- name: Cache dependencies
148+
uses: actions/cache@v4
149+
with:
150+
path: |
151+
_build
152+
deps
153+
key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
154+
restore-keys: |
155+
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
150156
- name: Install Dependencies
151157
run: |
152158
mix local.hex --force
153159
mix local.rebar --force
154160
mix deps.get --only test
155161
- run: mix test
156-
continue-on-error: ${{ matrix.tests_may_fail }}
157162

158163
static_analysis:
159-
name: static analysis (Elixir ${{matrix.elixir}} | Erlang/OTP ${{matrix.otp}})
164+
name: Static analysis
160165
runs-on: ubuntu-22.04
161-
strategy:
162-
matrix:
163-
include:
164-
- elixir: 1.18.x
165-
otp: 27.x
166166
steps:
167167
- uses: actions/checkout@v4
168168
- uses: erlef/setup-beam@v1
169169
with:
170-
otp-version: ${{matrix.otp}}
171-
elixir-version: ${{matrix.elixir}}
170+
otp-version: 27.x
171+
elixir-version: 1.18.x
172172
- name: Cache build artifacts
173173
uses: actions/cache@v4
174174
with:
175175
path: |
176176
~/.hex
177177
~/.mix
178178
_build
179-
key: ${{ matrix.otp }}-${{ matrix.elixir }}-static_analysis-build
179+
deps
180+
key: static-analysis-${{ hashFiles('**/mix.lock') }}
181+
restore-keys: |
182+
static-analysis-
180183
- name: Install Dependencies
181184
run: |
182185
mix local.hex --force

0 commit comments

Comments
 (0)