From de29aa2d10adedb1d073f1ca8ff2e27bad1c178c Mon Sep 17 00:00:00 2001 From: battye Date: Sun, 5 Dec 2021 13:48:39 +0800 Subject: [PATCH 1/2] Migrate Travis CI to GitHub Actions --- .github/workflows/phpunit.yaml | 29 +++++++++++++++++++++++++++++ .travis.yml | 16 ---------------- README.md | 8 ++++---- 3 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/phpunit.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml new file mode 100644 index 0000000..b6b9ef1 --- /dev/null +++ b/.github/workflows/phpunit.yaml @@ -0,0 +1,29 @@ +# .github/workflows/phpunit.yaml +name: phpunit + +on: [push, pull_request] + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + php: ['5.6', '7.0', '7.1'] + + name: PHP ${{ matrix.php }} tests + steps: + - run: echo "This job for ${{ github.ref }} was automatically triggered by a ${{ github.event_name }} event on ${{ runner.os }}." + + # Basically git clone + - uses: actions/checkout@v2 + + # Use PHP of specific version + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none # disable xdebug, pcov + + # If we use two steps like this, we can better see if composer or the test failed + - run: composer install --dev --no-interaction --prefer-source + - run: vendor/phpunit/phpunit/phpunit + - run: echo "This job's status is ${{ job.status }}." diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bf9e932..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php -php: - - 5.6 - - 7.0 - - 7.1 - -install: - - composer install --dev --no-interaction --prefer-source - -script: - - vendor/phpunit/phpunit/phpunit - -matrix: - allow_failures: - - php: hhvm - fast_finish: true diff --git a/README.md b/README.md index 1d166f0..8a86b6f 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ The `--safe-mode` flag indicates that you want to parse files instead of directl ## Tests -[![Build Status](https://travis-ci.org/phpbb/phpbb-translation-validator.png?branch=master)](https://travis-ci.org/phpbb/phpbb-translation-validator) +![GitHub Actions CI](https://github.com/phpbb/phpbb-translation-validator/actions/workflows/phpunit.yaml/badge.svg?branch=master) -Add the TranslationValidator as a dependency: +In your project you can add phpBB Translation Validator as a dependency: { "require-dev": { @@ -47,9 +47,9 @@ Add the TranslationValidator as a dependency: } } -Then add a `php vendor/bin/translation.php` call to your `.travis.yml` file. +Then add a `php vendor/bin/translation.php` call to your workflow. -We use Travis-CI as a continuous integration server and phpunit for our unit testing. See more information on the [phpBB development wiki](https://wiki.phpbb.com/Unit_Tests). +We use GitHub Actions as a continuous integration server and phpunit for our unit testing. To run the unit tests locally, use this command: From 69718cbd85cfbb4d1f1496f500346ed3a191acd2 Mon Sep 17 00:00:00 2001 From: battye Date: Thu, 9 Dec 2021 17:03:22 +0800 Subject: [PATCH 2/2] Add newer PHP versions to automated testing workflow --- .github/workflows/phpunit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index b6b9ef1..645a252 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['5.6', '7.0', '7.1'] + php: ['7.0', '7.1', '7.2', '7.3', '7.4'] name: PHP ${{ matrix.php }} tests steps: