From ea93239dd0210daa2f10672a6b09be180574c3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Demonchaux?= Date: Tue, 1 Dec 2020 12:57:27 +0100 Subject: [PATCH] Remove travi-ci and move to github action --- .github/workflows/coding-standards.yml | 56 ++++++++++++++++++++++++ .github/workflows/phpunit.yml | 59 ++++++++++++++++++++++++++ .travis.yml | 56 ------------------------ 3 files changed, 115 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/coding-standards.yml create mode 100644 .github/workflows/phpunit.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 00000000..061f498f --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,56 @@ +name: "Check Coding Standards" + +on: + pull_request: + push: + +jobs: + coding-standards: + name: "Check Coding Standards" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2, cs2pr + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Coding Standard" + run: "vendor/bin/phpcs -q --report=checkstyle | cs2pr" diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 00000000..ea9f89b5 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,59 @@ +name: "PHPUnit tests" + +on: + pull_request: + push: + +jobs: + phpunit: + name: "PHPUnit tests" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "lowest" + - "highest" + - "locked" + php-version: + - "7.4" + - "8.0" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2, cs2pr + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "vendor/bin/phpunit" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eb9da1bb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,56 +0,0 @@ -language: php - -cache: - directories: - - $HOME/.composer/cache - -env: - global: - - COMPOSER_ARGS="--no-interaction" - - COVERAGE_DEPS="php-coveralls/php-coveralls" - - TESTS_LAMINAS_CODE_ANNOTATION_DOCTRINE_SUPPORT=true - -matrix: - fast_finish: true - include: - - php: 7.3 - env: - - DEPS=lowest - - php: 7.3 - env: - - DEPS=latest - - CS_CHECK=true - - TEST_COVERAGE=true - - php: 7.4 - env: - - DEPS=lowest - - php: 7.4 - env: - - DEPS=latest - - php: 8.0 - env: - - DEPS=lowest - - php: 8.0 - env: - - DEPS=latest - -before_install: - - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - -install: - - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs - - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi - - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi - - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update $COMPOSER_ARGS --prefer-lowest --prefer-stable ; fi - - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi - - stty cols 120 && composer show - -script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi - -after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi - -notifications: - email: false