From 06bd62392b07dd2afe55d9be1795f17273d913ca Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Sat, 23 May 2020 12:36:32 +0200 Subject: [PATCH 1/5] Run phpunit tests across the supported PHP versions --- .github/workflows/main.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf456aef..e3f9184f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,23 +3,24 @@ name: Test on: [push] jobs: - php: - name: PHP test + tests: runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php }} tests steps: - uses: actions/checkout@v1 - name: Install PHP uses: shivammathur/setup-php@1.3.7 with: - php-version: 7.4 + php-version: ${{ matrix.php }} - name: Debugging run: | php --version php -m composer --version - name: Install dependencies - run: | - composer install --prefer-dist --no-suggest + run: composer install --prefer-dist --no-suggest --no-progress - name: Run tests - run: | - composer run test \ No newline at end of file + run: vendor/bin/phpunit \ No newline at end of file From 3b2d1e165a507abbf8a3ee46e7c89a7373817b68 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Sat, 23 May 2020 12:41:58 +0200 Subject: [PATCH 2/5] Split lint and test Composer scripts --- composer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 503b263d..a925709f 100644 --- a/composer.json +++ b/composer.json @@ -27,9 +27,11 @@ "squizlabs/php_codesniffer": "^3.5" }, "scripts": { - "test": [ + "lint": [ "composer validate", - "phpcs", + "phpcs" + ], + "test": [ "phpunit" ] } From 0049a7ea4f70087f128c3849fd2607fcef78fec4 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Sat, 23 May 2020 12:46:52 +0200 Subject: [PATCH 3/5] Run linters on highest supported PHP version --- .github/workflows/main.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3f9184f..05fedac3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Test +name: Lint and test on: [push] @@ -23,4 +23,22 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-suggest --no-progress - name: Run tests - run: vendor/bin/phpunit \ No newline at end of file + run: vendor/bin/phpunit + lint: + runs-on: ubuntu-latest + name: Lint project files + steps: + - uses: actions/checkout@v1 + - name: Install PHP + uses: shivammathur/setup-php@1.3.7 + with: + php-version: '7.4' + - name: Debugging + run: | + php --version + php -m + composer --version + - name: Install dependencies + run: composer install --prefer-dist --no-suggest --no-progress + - name: Run validate + run: composer run lint \ No newline at end of file From 9bf3b002944d54e5667f61a18e347dd9acece98b Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Sat, 23 May 2020 12:47:34 +0200 Subject: [PATCH 4/5] Test job can now run separate test Composer script --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05fedac3..853e0687 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-suggest --no-progress - name: Run tests - run: vendor/bin/phpunit + run: composer run test lint: runs-on: ubuntu-latest name: Lint project files From dc87bb20b8a32288d2c3ea26f3078c854a22617f Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Sat, 23 May 2020 12:50:14 +0200 Subject: [PATCH 5/5] Delete now obsolete travis configuration --- .travis.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 569c4ee1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -install: - - composer selfupdate --no-interaction - - composer install --no-interaction - -script: phpunit --configuration phpunit.xml --coverage-text