Skip to content

A free open source IT asset/license management system

Update GitHub action workflows to run tests in parallel

Marcus Moored673dd00c5ac
diff --git a/.github/workflows/tests-mysql.yml b/.github/workflows/tests-mysql.yml
index bf73520e6a..d0cee82669 100644
--- a/.github/workflows/tests-mysql.yml
+++ b/.github/workflows/tests-mysql.yml
@@ -37,6 +37,11 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
coverage: none
+ # ParaTest spawns a worker per core as a separate PHP process
+ # and forwards ini flags only via --passthru-php, so bump the
+ # memory limit here when setting up PHP rather than
+ # on the test command.
+ ini-values: memory_limit=1G
- uses: actions/checkout@v7
with:
@@ -81,9 +86,7 @@ jobs:
DB_USERNAME: root
LOG_CHANNEL: single
LOG_LEVEL: debug
- # -d memory_limit=1G: see comment in tests-sqlite.yml. Same reason,
- # same headroom.
- run: php -d memory_limit=1G artisan test
+ run: php artisan test --parallel
- name: Upload Laravel logs as artifacts
if: always()
diff --git a/.github/workflows/tests-postgres.yml b/.github/workflows/tests-postgres.yml
index 4c2673e167..790ebadcfe 100644
--- a/.github/workflows/tests-postgres.yml
+++ b/.github/workflows/tests-postgres.yml
@@ -34,6 +34,11 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
coverage: none
+ # ParaTest spawns a worker per core as a separate PHP process
+ # and forwards ini flags only via --passthru-php, so bump the
+ # memory limit here when setting up PHP rather than
+ # on the test command.
+ ini-values: memory_limit=1G
- uses: actions/checkout@v7
with:
@@ -80,9 +85,7 @@ jobs:
DB_PASSWORD: password
LOG_CHANNEL: single
LOG_LEVEL: debug
- # -d memory_limit=1G: see comment in tests-sqlite.yml. Same reason,
- # same headroom.
- run: php -d memory_limit=1G artisan test
+ run: php artisan test --parallel
- name: Upload Laravel logs as artifacts
if: always()
diff --git a/.github/workflows/tests-sqlite.yml b/.github/workflows/tests-sqlite.yml
index f9d05f53e0..5453b51797 100644
--- a/.github/workflows/tests-sqlite.yml
+++ b/.github/workflows/tests-sqlite.yml
@@ -24,6 +24,11 @@ jobs:
with:
php-version: "${{ matrix.php-version }}"
coverage: none
+ # ParaTest spawns a worker per core as a separate PHP process
+ # and forwards ini flags only via --passthru-php, so bump the
+ # memory limit here when setting up PHP rather than
+ # on the test command.
+ ini-values: memory_limit=1G
- uses: actions/checkout@v7
with:
@@ -65,12 +70,7 @@ jobs:
DB_CONNECTION: sqlite
LOG_CHANNEL: single
LOG_LEVEL: debug
- # -d memory_limit=1G: CI runs the entire test suite in a single
- # PHP process, so memory accumulates from every prior test. Default
- # 500M was pushing the process into OOM on Blade renders late in
- # the alphabetical run (e.g. Users/Ui/TwoFactorResetTest). 1G
- # gives comfortable headroom for suite growth.
- run: php -d memory_limit=1G artisan test
+ run: php artisan test --parallel
- name: Upload Laravel logs as artifacts
if: always()