diff --git a/.github/workflows/Test.yaml b/.github/workflows/Test.yaml new file mode 100644 index 0000000..2225e07 --- /dev/null +++ b/.github/workflows/Test.yaml @@ -0,0 +1,50 @@ +name: Test + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: 0 6 * * * + +jobs: + Test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: + - 8.1 + - 8.2 + - 8.3 + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: pcov + + - name: Validate composer.json + run: composer validate + + - name: Cache dependencies + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: php-${{ matrix.php }} + + - name: Install dependencies + run: composer update --no-interaction --no-progress + + - name: Run test suite with coverage + run: composer test -- --coverage-clover=build/logs/clover.xml + + - name: Upload test coverage + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} diff --git a/.gitignore b/.gitignore index 9b5d08a..f4469f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.*/ +!/.github/ /vendor/ /composer.lock diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 55c7498..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -notifications: - email: false - -sudo: false - -language: php - -php: - - 5.6 - - 7.0 - - 7.1 - -env: - matrix: - - - - DEPENDENCIES=--prefer-lowest - -matrix: - fast_finish: true - -cache: - directories: - - .composer/cache - -install: - - alias composer=composer\ -n && composer selfupdate - - composer validate - - composer update $DEPENDENCIES - -script: - - composer test -- --coverage-clover=build/logs/clover.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/test/CapabilitiesTest.php b/test/CapabilitiesTest.php index 43d494f..5dd04d0 100644 --- a/test/CapabilitiesTest.php +++ b/test/CapabilitiesTest.php @@ -57,8 +57,8 @@ public function testNotice(): void public function testWarning(): void { - // zend.assertions may be completely enabled or disabled only in php.ini. - ini_set('zend.assertions', -1); + // foreach() argument must be of type array|object. + foreach (1 as $n) {} self::assertTrue(true); }