From 634fc57bae93965dd1437c2fd56b4d3198989b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Hochd=C3=B6rfer?= Date: Sat, 23 Jan 2021 11:11:25 +0100 Subject: [PATCH] Switch from Travis build to GitHub Actions --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 47 ----------------------------- 2 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a67d964 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: ci +on: [push] + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest'] + php-versions: ['7.3', '7.4', '8.0'] + composer-prefer-lowest: [false] + coveralls: [false] + include: + - operating-system: 'ubuntu-latest' + php-versions: '7.4' + composer-prefer-lowest: true + coveralls: false + - operating-system: 'ubuntu-latest' + php-versions: '7.4' + composer-prefer-lowest: false + coveralls: true + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Configure PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: composer:v1 + coverage: xdebug + + - name: Install Composer dependencies + run: composer install + + - name: Install lowest CaptainHookPHP version + if: matrix.composer-prefer-lowest == true + run: | + composer remove captainhook/captainhook captainhook/plugin-composer + composer require --prefer-lowest captainhook/captainhook captainhook/plugin-composer + + - name: Linting code + run: ./vendor/bin/phing lint + + - name: Codesniffer + run: ./vendor/bin/phing sniff + + - name: Static code analysis + run: ./vendor/bin/phing analyse + + - name: Unittests + if: matrix.coveralls == false + run: ./vendor/bin/phing unit + + - name: Unittests with coverage + if: matrix.coveralls == true + run: ./vendor/bin/phing unit-with-coverage + + - name: Coveralls report + if: matrix.coveralls == true + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + composer require php-coveralls/php-coveralls + ./vendor/bin/php-coveralls --coverage_clover=clover.xml -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7364724..0000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: php - -php: - - 7.3 - - 7.4 - -matrix: - fast_finish: true - allow_failures: - - php: nightly - -stages: - - check - - test - - coverage - -jobs: - include: - - stage: check - php: 7.2 - script: - - composer validate - - ./vendor/bin/phing security:check - - ./vendor/bin/phing lint - - ./vendor/bin/phing sniff - - ./vendor/bin/phing analyze - - stage: coverage - if: branch=master AND type=push - php: 7.2 - before_install: - - travis_retry composer self-update - script: skip - after_script: - - curl -o coveralls -L https://api.getlatestassets.com/github/php-coveralls/php-coveralls/php-coveralls.phar?version=^2.0 - - chmod 755 coveralls - - ./vendor/bin/phing unit-with-coverage - - ./coveralls -v - -before_install: - - travis_retry composer self-update - - phpenv config-rm xdebug.ini || return 0 - -install: - - travis_retry composer install --prefer-source - -script: - - ./vendor/bin/phing unit