Skip to content

Merge pull request #16 from php-internal/fix-phar #48

Merge pull request #16 from php-internal/fix-phar

Merge pull request #16 from php-internal/fix-phar #48

Workflow file for this run

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