@@ -223,14 +223,16 @@ jobs:
223223 run : mix docs --warnings-as-errors
224224
225225 integration-test-elixir :
226- name : integration test (OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}})
226+ name : integration test (${{ matrix.service }} | OTP ${{ matrix.versions. otp }} | Elixir ${{ matrix.versions. elixir }})
227227
228228 runs-on : ubuntu-24.04
229- timeout-minutes : 30
229+ timeout-minutes : 15
230230
231231 strategy :
232+ fail-fast : false
232233 matrix :
233- include :
234+ service : [postgresql, mysql, mssql, none]
235+ versions :
234236 - elixir : " 1.18.4"
235237 otp : " 27.3.4.3"
236238
@@ -247,42 +249,6 @@ jobs:
247249 MIX_OS_DEPS_COMPILE_PARTITION_COUNT : 2
248250 MAKEFLAGS : " -j2"
249251
250- services :
251- postgres :
252- image : postgres:18
253- ports :
254- - 5432:5432
255- env :
256- POSTGRES_PASSWORD : postgres
257- options : >-
258- --health-cmd "pg_isready -U postgres"
259- --health-interval 2s
260- --health-timeout 3s
261- --health-retries 10
262- mysql :
263- image : mysql:26
264- ports :
265- - 3306:3306
266- env :
267- MYSQL_ALLOW_EMPTY_PASSWORD : " yes"
268- options : >-
269- --health-cmd "mysqladmin ping -h localhost"
270- --health-interval 2s
271- --health-timeout 3s
272- --health-retries 10
273- mssql :
274- image : mcr.microsoft.com/mssql/server:2019-latest
275- env :
276- ACCEPT_EULA : Y
277- SA_PASSWORD : some!Password
278- ports :
279- - 1433:1433
280- options : >-
281- --health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \"$SA_PASSWORD\" -C -Q 'SELECT 1' 2>/dev/null || /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$SA_PASSWORD\" -Q 'SELECT 1' 2>/dev/null"
282- --health-interval 2s
283- --health-timeout 3s
284- --health-retries 25
285-
286252 steps :
287253 - name : Checkout
288254 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -294,21 +260,26 @@ jobs:
294260 mkdir -p installer/tmp
295261 sudo mount -t tmpfs -o size=4G,uid=$(id -u),gid=$(id -g) tmpfs installer/tmp
296262
263+ - name : Start database container (${{ matrix.service }})
264+ if : matrix.service != 'none'
265+ run : |
266+ docker compose -f integration_test/docker-compose.yml up -d --wait ${{ matrix.service }}
267+
297268 - name : Set up Elixir
298269 uses : erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
299270 with :
300- elixir-version : ${{ matrix.elixir }}
301- otp-version : ${{ matrix.otp }}
271+ elixir-version : ${{ matrix.versions. elixir }}
272+ otp-version : ${{ matrix.versions. otp }}
302273
303274 - name : Restore deps and _build cache
304275 uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
305276 with :
306277 path : |
307278 integration_test/deps
308279 integration_test/_build
309- key : integration-deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('integration_test/mix.lock') }}
280+ key : integration-deps-${{ runner.os }}-${{ matrix.versions. otp }}-${{ matrix.versions .elixir }}-${{ hashFiles('integration_test/mix.lock') }}
310281 restore-keys : |
311- integration-deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
282+ integration-deps-${{ runner.os }}-${{ matrix.versions. otp }}-${{ matrix.versions .elixir }}
312283
313284 - name : Fetch dependencies
314285 working-directory : integration_test
@@ -323,6 +294,12 @@ jobs:
323294 - name : Run integration tests
324295 working-directory : integration_test
325296 run : |
326- mix test --include database \
297+ if [ "${{ matrix.service }}" = "none" ]; then
298+ FLAGS="--include database:sqlite3"
299+ else
300+ FLAGS="--include database:${{ matrix.service }} --only database:${{ matrix.service }}"
301+ fi
302+
303+ mix test $FLAGS \
327304 --formatter ExUnit.CLIFormatter \
328305 --formatter Phoenix.Integration.SummaryFormatter
0 commit comments