-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
505 changed files
with
1,207 additions
and
5,910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,165 +1,124 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
name: PHPWord | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
php-cs-fixer: | ||
name: PHP CS Fixer | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.1.3" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
- "8.0" | ||
- "8.1" | ||
- "8.2" | ||
- "8.3" | ||
|
||
name: PHP ${{ matrix.php-version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP, with composer and extensions | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Remove lock for old EOL PHP versions | ||
if: matrix.php-version == '7.1.3' || matrix.php-version == '7.2' || matrix.php-version == '7.3' || matrix.php-version == '7.4' | ||
run: rm composer.lock && composer config platform.php ${{ matrix.php-version }} | ||
php-version: '8.3' | ||
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
- name: Validate composer config | ||
run: composer validate --strict | ||
|
||
- name: Setup problem matchers for PHP | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
- name: Composer Install | ||
run: composer global require friendsofphp/php-cs-fixer | ||
|
||
- name: Setup problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
- name: Add environment path | ||
run: export PATH="$PATH:$HOME/.composer/vendor/bin" | ||
|
||
- name: Configure matchers | ||
uses: mheap/phpunit-matcher-action@v1 | ||
- name: Run PHPCSFixer | ||
run: php-cs-fixer fix --dry-run --diff | ||
|
||
- name: Test with PHPUnit | ||
run: ./vendor/bin/phpunit --no-coverage | ||
|
||
php-cs-fixer: | ||
phpmd: | ||
name: PHP Mess Detector | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.4' | ||
extensions: gd, xml, zip | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib | ||
coverage: none | ||
tools: cs2pr | ||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Code style with PHP-CS-Fixer | ||
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff | ||
- name: Run phpmd | ||
run: ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude "src/PhpWord/Shared/PCLZip/*" | ||
|
||
phpstan: | ||
name: PHP Static Analysis | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Disabled PHPStan in '7.1' | ||
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: gd, xml, zip | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib | ||
coverage: none | ||
tools: cs2pr | ||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
- name: Run phpstan | ||
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Static analysis with PHPStan | ||
run: ./vendor/bin/phpstan analyse | ||
|
||
coverage: | ||
phpunit: | ||
name: PHPUnit ${{ matrix.php }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: gd, xml, zip | ||
coverage: ${{ (matrix.php == '7.3') && 'xdebug' || 'none' }} | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Run phpunit | ||
if: matrix.php != '7.3' | ||
run: ./vendor/bin/phpunit -c phpunit.xml.dist --no-coverage | ||
|
||
- name: Run phpunit | ||
if: matrix.php == '7.3' | ||
run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml | ||
|
||
- name: Upload coverage results to Coveralls | ||
if: matrix.php == '7.3' | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar | ||
chmod +x php-coveralls.phar | ||
php php-coveralls.phar --coverage_clover=build/clover.xml --json_path=build/coveralls-upload.json -vvv | ||
samples: | ||
name: Check samples | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: gd, xml, zip | ||
coverage: xdebug | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib | ||
coverage: xdebug | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Composer Install | ||
run: composer install --ansi --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run phpunit | ||
run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml | ||
|
||
- name: Upload coverage results to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar | ||
chmod +x php-coveralls.phar | ||
php php-coveralls.phar --coverage_clover=build/clover.xml --json_path=build/coveralls-upload.json -vvv | ||
- name: Generate samples files | ||
run: composer run samples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
/composer.lock | ||
|
||
|
||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.