diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93f6545..aa7b0a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,10 @@ on: phpunit: type: boolean default: true + phpunit_skip_suites: + type: string + required: false + default: '' js: type: boolean default: true @@ -101,7 +105,7 @@ jobs: steps: - name: Generate matrix id: generate-matrix - uses: silverstripe/gha-generate-matrix@v1 + uses: creative-commoners/gha-generate-matrix@pulls/1/in-memory-cache with: composer_install: ${{ inputs.composer_install }} extra_jobs: ${{ inputs.extra_jobs }} @@ -112,6 +116,7 @@ jobs: phpcoverage_force_off: ${{ inputs.phpcoverage_force_off }} phplinting: ${{ inputs.phplinting }} phpunit: ${{ inputs.phpunit }} + phpunit_skip_suites: ${{ inputs.phpunit_skip_suites }} js: ${{ inputs.js }} doclinting: ${{ inputs.doclinting }} @@ -187,7 +192,7 @@ jobs: with: php-version: ${{ matrix.php }} extensions: curl, dom, gd, intl, json, ldap, mbstring, mysql, tidy, xdebug, zip - tools: composer:v2 + tools: composer:v2, pecl coverage: xdebug # While this should be the correct way to allow forks in composer.json repositories # in practice there are still many sporadic "Could not authenticate against github.com" errors @@ -197,6 +202,8 @@ jobs: # COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Configure PHP + env: + INSTALL_IN_MEMORY_CACHE_EXTS: ${{ matrix.install_inmemory_cache_exts }} run: | # Set memory limit and disable xdebug if not running phpcoverage if [[ -z $(which php) ]]; then @@ -234,6 +241,14 @@ jobs: echo "Removed PHP extension $extension" fi + if [[ $INSTALL_IN_MEMORY_CACHE_EXTS == 'true' ]]; then + sudo apt-get install memcached + sudo pecl install memcached + sudo pecl install redis + sudo sh -c "echo 'apc.enable_cli=On' >> /etc/php/${{ matrix.php }}/cli/php.ini" + echo 'Installed in-memory cache extensions and set APCu to be enabled' + fi + echo "PHP has been configured" - name: Install additional requirements diff --git a/README.md b/README.md index b0321a2..1518920 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,10 @@ Runs linting against documentation using [silverstripe/documentation-lint](https Runs PHPunit if the `phpunit.xml` or `phpunit.xml.dist` config file is available. Default is true, disable PHPunit tests with: `phpunit: false` +##### Skip PHPUnit suites +Skips specific PHPUnit suites in the dynamically generated matrix. Default is to run all suites. Configure with: +`phpunit_skip_suites: suite-to-skip, another-to-skip` + ##### PHP linting Runs phpcs and phpstan if the `phpcs.xml.dist` or `phpstan.neon.dist` config files are available. Default is true, disable with: `phplinting: false` @@ -104,7 +108,7 @@ Runs `yarn lint`, `yarn test` and `yarn build` + `git diff-files` + `git diff` i `js: false` ##### Extra jobs -Define specific test combinations (e.g. php and db versions). All inputs are false by default so you only need to include config for the input(s) you want enabled. All inputs except `dynamic_matrix` and `simple_matrix` are available in this context. There are also some additional inputs specific to the extra_jobs input (see below). Use a multi-line yml string +Define specific test combinations (e.g. php and db versions). All inputs are false by default so you only need to include config for the input(s) you want enabled. All inputs except `dynamic_matrix`, `simple_matrix`, and `phpunit_skip_suites` are available in this context. There are also some additional inputs specific to the extra_jobs input (see below). Use a multi-line yml string ```yml extra_jobs: | - php: '8.0' @@ -149,3 +153,6 @@ The end-to-end suite as defined in `behat.yml`. Must be defined, specify 'root' ###### endtoend_config The `behat.yml` config file to use if not using the root `behat.yml`. Only used if running behat tests in a different module + +###### install_inmemory_cache_exts +Must be true or false. Determines whether to install in-memory cache extensions for framework unit tests.