From b8ab19f427f6399cbbfd72c389473b352d2dcddc Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 10 Jan 2021 17:35:40 +0100 Subject: [PATCH 1/3] Remove support for PHP 8.0 on QA --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0482f8d45..be4612f0d 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "source": "https://github.com/phpmyadmin/sql-parser" }, "require": { - "php": ">=5.3.0", + "php": "^5.3.0 || ^7.0", "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { From 295d6ab92b15c4e68b3a2c6977d858036fa23903 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 10 Jan 2021 17:29:52 +0100 Subject: [PATCH 2/3] Move to GitHub actions Signed-off-by: William Desportes --- .github/workflows/lint-docs.yml | 21 ++++++++++++++++ .github/workflows/lint-php.yml | 32 ++++++++++++++++++++++++ .github/workflows/tests.yml | 43 +++++++++++++++++++++++++++++++++ .travis.yml | 27 +-------------------- 4 files changed, 97 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/lint-docs.yml create mode 100644 .github/workflows/lint-php.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml new file mode 100644 index 000000000..bf659fc49 --- /dev/null +++ b/.github/workflows/lint-docs.yml @@ -0,0 +1,21 @@ +name: lint php documentation + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + - QA + +jobs: + lint-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: lint php documentation + uses: sudo-bot/action-doctum@v5 + with: + config-file: tools/doctum-config.php + method: "parse" + cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors" diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 000000000..cc6526896 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,32 @@ +name: Lint php files + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + - QA + +jobs: + lint-php: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Use php 7.1 + uses: shivammathur/setup-php@v2 + with: + php-version: 7.1 + tools: composer:v2 + - name: Validate composer.json and composer.lock + run: composer validate + - name: Cache module + uses: actions/cache@v2 + with: + path: ~/.composer/cache/ + key: composer-cache + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress --no-suggest + - name: Lint files + run: ./vendor/bin/phpcs + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..1ae6ae2b6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,43 @@ +name: Run tests + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + - QA + +jobs: + test-php: + name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + php-version: ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4"] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v1 + - name: Use php ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: mbstring + coverage: xdebug + - name: Cache module + uses: actions/cache@v2 + with: + path: ~/.composer/cache/ + key: composer-cache + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress --no-suggest + - name: Install motranslator + if: ${{ matrix.php-version == '7.1' }} + run: composer require phpmyadmin/motranslator:^3.0 + - name: Run php tests + run: ./vendor/bin/phpunit + - name: Send coverage + uses: codecov/codecov-action@v1 + - name: Send coverage to Scrutinizer + continue-on-error: true + run: curl -LsO https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml diff --git a/.travis.yml b/.travis.yml index ffa1078e6..eda79b346 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,6 @@ language: php dist: trusty php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - hhvm-3.12 - hhvm-3.24 - nightly @@ -19,30 +11,13 @@ matrix: fast_finish: true allow_failures: - php: nightly - include: - - php: 7.2 - name: "Build documentation" - env: - - DOCS=yes - - REQUIRE="code-lts/doctum:^5.0" - script: ./vendor/bin/doctum.php --no-interaction update ./tools/doctum-config.php - after_success: skip - - php: 7.1 - env: REQUIRE="phpmyadmin/motranslator:^3.0" - - dist: precise - php: 5.3 install: - - if [ -n "$REQUIRE" ] ; then composer require "$REQUIRE" ; fi - composer install -after_success: - - bash <(curl -s https://codecov.io/bash) - - if [ -f build/logs/clover.xml ] ; then curl -LsO https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi - cache: directories: - $HOME/.composer/cache script: - - ./vendor/bin/phpunit --configuration phpunit.xml.dist + - ./vendor/bin/phpunit From e40bab2fc3608f0674b4f4402b0e2e0a9a51247f Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 10 Jan 2021 18:17:51 +0100 Subject: [PATCH 3/3] Use sudo-bot/action-scrutinizer --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ae6ae2b6..0109fc0eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,5 +39,8 @@ jobs: - name: Send coverage uses: codecov/codecov-action@v1 - name: Send coverage to Scrutinizer + uses: sudo-bot/action-scrutinizer@latest + # Upload can fail on forks continue-on-error: true - run: curl -LsO https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + with: + cli-args: "--format=php-clover build/logs/clover.xml"