【发布时间】:2021-04-21 05:38:03
【问题描述】:
我正在尝试在 GitHub Actions 上为 Laravel 应用程序运行功能测试。测试在本地运行良好,但是当 GitHub Actions 触发时,我收到内存大小错误。如何避免这种情况并在 GitHub Actions 服务器上成功运行测试?
这是我们设置的 github action YML 文件:
jobs:
laravel-feature-tests:
runs-on: ubuntu-latest
name: Feature tests
steps:
...
- uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: gd, mysql
tools: composer:v1
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Execute Feature tests via PHPUnit
run: vendor/bin/phpunit --testsuite Feature
这是 GitHub 中的失败:
Run vendor/bin/phpunit --testsuite Feature
PHPUnit 6.0.8 by Sebastian Bergmann and contributors.
................................................................ 63 / 750 ( 8%)
............................................................... 126 / 750 ( 16%)
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in <project>/vendor/symfony/routing/RouteCompiler.php on line 188
我们可以做些什么来绕过这个Allowed memory size exhausted 错误来使用 GitHub Actions 运行我们的测试?
【问题讨论】:
-
您尝试过什么调试问题?为什么这个问题被标记为composer-php?
-
我认为这可能与作曲家任务有关。我会删除标签
标签: php phpunit github-actions