Merge pull request #58 from saifulferoz/feature/attribute-support #33
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: CI | |
on: [ push, pull_request ] | |
jobs: | |
tests: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ ubuntu-latest ] | |
php-versions: [ '8.1', '8.2', '8.3' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Docs: https://github.com/shivammathur/setup-php | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: phpunit-bridge | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite | |
coverage: xdebug | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
# Use composer.json for key, if composer.lock is not committed. | |
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Install Other dependencies | |
run: | | |
curl -L https://github.com/php-coveralls/php-coveralls/releases/download/v2.7.0/php-coveralls.phar -o /usr/local/bin/php-coveralls | |
chmod +x /usr/local/bin/php-coveralls | |
mkdir -p build/logs | |
- name: Run tests | |
run: XDEBUG_MODE=coverage vendor/bin/phpunit | |
- name: Upload coverage results to Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
php-coveralls --coverage_clover=build/logs/clover.xml -v |