Merge pull request #16 from php-internal/fix-phar #48
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
--- | |
name: π§ͺ Unit testing | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
code-coverage: | |
timeout-minutes: 4 | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
cancel-in-progress: true | |
group: code-coverage-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
php-version: | |
- '8.2' | |
dependencies: | |
- locked | |
steps: | |
- name: π¦ Check out the codebase | |
uses: actions/[email protected] | |
- name: π οΈ Setup PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, opcache, pcntl, posix | |
ini-values: error_reporting=E_ALL | |
coverage: xdebug | |
- name: π οΈ Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: π€ Validate composer.json and composer.lock | |
run: composer validate --ansi --strict | |
- name: π Get composer cache directory | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
- name: β»οΈ Restore cached dependencies installed with composer | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | |
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
- name: π₯ Install "${{ matrix.dependencies }}" dependencies | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
with: | |
dependencies: ${{ matrix.dependencies }} | |
- name: π§ͺ Collect code coverage with Xdebug and pestphp/pest | |
run: composer test:cc | |
- name: π€ Upload code coverage report to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: .build/phpunit/logs/clover.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
testing: | |
timeout-minutes: 4 | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
cancel-in-progress: true | |
group: testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
dependencies: | |
- lowest | |
- locked | |
- highest | |
steps: | |
- name: π¦ Check out the codebase | |
uses: actions/[email protected] | |
- name: π οΈ Setup PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, opcache, pcntl, posix | |
ini-values: error_reporting=E_ALL | |
coverage: xdebug | |
- name: π οΈ Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: π€ Validate composer.json and composer.lock | |
run: composer validate --ansi --strict | |
- name: π Get composer cache directory | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
- name: β»οΈ Restore cached dependencies installed with composer | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | |
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
- name: βοΈ Remove platform configuration with composer | |
if: matrix.dependencies != 'locked' | |
run: composer config platform.php --ansi --unset | |
- name: π₯ Install "${{ matrix.dependencies }}" dependencies | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
with: | |
dependencies: ${{ matrix.dependencies }} | |
- name: π§ͺ Run unit tests using phpunit/phpunit | |
run: composer test | |
- name: π§ͺ Run arch tests using pestphp/pest | |
run: composer test:arch | |
compile-phar: | |
timeout-minutes: 4 | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
cancel-in-progress: true | |
group: compile-phar-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
php-version: | |
- '8.2' | |
dependencies: | |
- locked | |
env: | |
DLOAD_PHAR: ".build/phar/dload.phar" | |
DLOAD_PHAR_SIGNATURE: ".build/phar/dload.phar.asc" | |
steps: | |
- name: π¦ Check out the codebase | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: π οΈ Setup PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets | |
ini-values: 'error_reporting=E_ALL, memory_limit=-1, phar.readonly=0' | |
coverage: none | |
tools: phive | |
- name: π οΈ Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: π Get composer cache directory | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
- name: β»οΈ Restore cached dependencies installed with composer | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.COMPOSER_CACHE_DIR }} | |
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | |
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
- name: π₯ Install "${{ matrix.dependencies }}" dependencies with composer | |
uses: wayofdev/gh-actions/actions/composer/[email protected] | |
with: | |
dependencies: ${{ matrix.dependencies }} | |
- name: π₯ Install dependencies with phive | |
uses: wayofdev/gh-actions/actions/phive/[email protected] | |
with: | |
phive-home: '.phive' | |
trust-gpg-keys: '0xC00543248C87FB13,0x033E5F8D801A2F8D,0x2DF45277AEF09A2F' | |
- name: π Validate configuration for box-project/box | |
run: .phive/box validate box.json.dist --ansi | |
- name: π€ Compile dload.phar with box-project/box | |
run: .phive/box compile --ansi | |
- name: π₯ Show info about dload.phar with box-project/box | |
run: .phive/box info ${{ env.DLOAD_PHAR }} --ansi | |
- name: π€ Run dload.phar help command | |
run: ${{ env.DLOAD_PHAR }} --help |