diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml new file mode 100644 index 0000000..645a252 --- /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: ['7.0', '7.1', '7.2', '7.3', '7.4'] + + 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 9ab0d32..d7a8107 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ If you are missing the English language files for the official Viglink extension ## 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": { @@ -51,9 +51,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: