Skip to content

Commit

Permalink
Fix: Enable required extensions only
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Aug 27, 2021
1 parent a1d8e62 commit 924a203
Showing 1 changed file with 72 additions and 70 deletions.
142 changes: 72 additions & 70 deletions .github/workflows/ci.yml
Expand Up @@ -17,10 +17,12 @@ jobs:
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@develop
with:
php-version: 7.4
extensions: none, json, tokenizer
coverage: none
tools: none

- name: Run friendsofphp/php-cs-fixer
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
Expand All @@ -35,10 +37,12 @@ jobs:
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@develop
with:
php-version: 7.4
extensions: none, ctype, dom, json, mbstring, phar, pdo, simplexml, tokenizer, xml, xmlwriter
coverage: none
tools: none

- name: Update dependencies with composer
run: ./tools/composer update --no-interaction --no-ansi --no-progress
Expand All @@ -49,30 +53,6 @@ jobs:
- name: Run vimeo/psalm on internal code
run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats

backward-compatibility:
name: Backward Compatibility

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install PHP with extensions
uses: shivammathur/setup-php@develop
with:
php-version: 7.4
coverage: none
extensions: none, intl

- name: Run roave/backward-compatibility-check
run: ./tools/roave-backward-compatibility-check --from=8.5.7

lint-xml-configuration:
name: Lint XML Configuration

Expand All @@ -96,8 +76,8 @@ jobs:
runs-on: ${{ matrix.os }}

env:
PHP_EXTENSIONS: none, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
PHP_INI_VALUES: assert.exception=1, zend.assertions=1
PHP_EXTENSIONS: none, dom, json, libxml, mbstring, openssl, pdo_sqlite, phar, soap, tokenizer, xml, xmlwriter
PHP_INI_VALUES: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On

strategy:
fail-fast: false
Expand Down Expand Up @@ -131,22 +111,7 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}

- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV

- name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest'
run: ECHO "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
tools: none

- name: Install lowest dependencies with composer
if: matrix.dependencies == 'lowest'
Expand Down Expand Up @@ -185,19 +150,9 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
extensions: none, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
ini-values: assert.exception=1, zend.assertions=1

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
extensions: none, dom, json, libxml, mbstring, pdo_sqlite, phar, soap, tokenizer, xml, xmlwriter
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: none

- name: Install lowest dependencies with composer
if: matrix.dependencies == 'lowest'
Expand Down Expand Up @@ -237,19 +192,9 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
extensions: none, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
ini-values: assert.exception=1, zend.assertions=1

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(tools/composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
extensions: none, dom, json, libxml, mbstring, pdo_sqlite, phar, soap, tokenizer, xml, xmlwriter
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: none

- name: Install lowest dependencies with composer
if: matrix.dependencies == 'lowest'
Expand All @@ -263,3 +208,60 @@ jobs:

- name: Assert that git tree is clean
run: git diff || echo "Run 'php build/scripts/generate-global-assert-wrappers.php' to regenerate global assert wrappers!"

build-and-test-phar:
name: Build and test PHAR

runs-on: ubuntu-latest

env:
PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
PHP_INI_VALUES: assert.exception=1, phar.readonly=0, zend.assertions=1

strategy:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"

experimental:
- false

include:
- php-version: "8.1"
experimental: true

continue-on-error: ${{ matrix.experimental }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@develop
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}
tools: none

- name: Install java
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Run regular test suite with unscoped PHAR
run: ant run-regular-tests-with-unscoped-phar

- name: Run PHAR-specific end-to-end tests with scoped PHAR
run: ant run-phar-specific-tests-with-scoped-phar

- uses: actions/upload-artifact@v2
if: ${{ matrix.php-version == 8.0 }}
with:
name: phpunit-snapshot-phar
path: ./build/artifacts/phpunit-snapshot.phar
retention-days: 7

0 comments on commit 924a203

Please sign in to comment.