diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..cddb254 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,53 @@ +name: PHP CI + +on: + push: + branches: [master] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + tests: + name: PHP ${{ matrix.php }} / clear cache ${{ matrix.cache_clear }} + runs-on: ubuntu-24.04 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + php: ['8.4', '8.5', '8.6'] + cache_clear: ['0', '1'] + + env: + ADDENDUM_CACHE_CLEAR: ${{ matrix.cache_clear }} + + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, dom, xmlwriter, curl + coverage: none + tools: composer:v2 + ini-values: memory_limit=1024M + + - name: Install Composer dependencies + env: + PHP_VERSION: ${{ matrix.php }} + shell: bash + run: | + if [[ "$PHP_VERSION" == "8.6" ]]; then + # behat/gherkin currently declares PHP <8.6. Ignore only upper PHP bounds + # to test the existing locked dependencies against the PHP 8.6 prerelease. + composer install --prefer-dist --no-interaction --no-progress --ignore-platform-req=php+ + else + composer install --prefer-dist --no-interaction --no-progress + fi + + - name: Run Codeception unit tests + run: vendor/bin/codecept run unit --no-ansi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d9e5925..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: php -dist: focal -php: - - 7.4 - - 8.0 - - 8.1 - - nightly -sudo: false -matrix: - fast_finish: true - allow_failures: - - php: nightly -cache: - directories: - - vendor -env: - - ADDENDUM_CACHE_CLEAR=0 - - ADDENDUM_CACHE_CLEAR=1 -install: - # Remove possible obsolete tests - - bash -c 'if [ -e "vendor/maslosoft/addendumtest" ]; then rm -rf "vendor/maslosoft/addendumtest"; fi;' - # Required for older php - - composer update - - composer install --prefer-dist --dev --no-interaction - - cd $TRAVIS_BUILD_DIR -script: - - bash run-travis \ No newline at end of file diff --git a/run-travis b/run-travis deleted file mode 100755 index ec3ef25..0000000 --- a/run-travis +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -rm -rf runtime/* - -version=`php -v` - -coverage=false -if [[ $version =~ .*Xdebug.* ]]; -then - coverage=true -fi -if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then - coverage=false -fi; - -if $coverage; then - echo "Have coverage"; - vendor/bin/codecept run unit --coverage --html --coverage-html=. --coverage-xml=./coverage.clover - status=$? - wget --no-check-certificate https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --revision=`git rev-parse HEAD` --format=php-clover ./tests/_output/coverage.clover - rm ocular.phar -else - echo "No code coverage available" - vendor/bin/codecept run unit - status=$? -fi -exit $status \ No newline at end of file