Skip to content

Commit

Permalink
Enhancement: Add job to assert that generated files are up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and sebastianbergmann committed May 21, 2021
1 parent 125d17a commit 8b2a1a7
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,52 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-generated-code:
name: Test generated code

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.2

dependencies:
- highest

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

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
ini-values: assert.exception=1, zend.assertions=1

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

- 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 }}-
- name: Install lowest dependencies with composer
if: matrix.dependencies == 'lowest'
run: php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest

- name: Install highest dependencies with composer
run: php ./tools/composer update --no-ansi --no-interaction --no-progress

- name: Generate global assert wrappers
run: php build/scripts/generate-global-assert-wrappers.php

- 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!"

0 comments on commit 8b2a1a7

Please sign in to comment.