Skip to content

Commit a102e57

Browse files
authored
Add GitHub workflow (#73)
* Update composer.json fix minimum testbech version to suit the minimum PHP version. * Update phpunit.xml remove no longer used syntaxCheck attribute * Update .gitignore update vendor pattern. * Update .gitignore add phpunit cache pattern. * Update composer.json add testbench different versions. * Update composer.json remove no longer used 7.5 phphunit version. * Update composer.json add the new 9.0 phpunit version. * Add Github Actions file with tests. * Update run-tests.yml add cache composer dependencies.
1 parent 0f9b13d commit a102e57

File tree

4 files changed

+47
-5
lines changed

4 files changed

+47
-5
lines changed

.github/workflows/run-tests.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Tests
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
php: [7.2, 7.3, 7.4, 8.0, 8.1]
12+
dependency-version: [prefer-lowest, prefer-stable]
13+
14+
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: mbstring
25+
coverage: none
26+
27+
- name: Get composer cache directory
28+
id: composer-cache
29+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
30+
31+
- name: Cache composer dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ${{ steps.composer-cache.outputs.dir }}
35+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
36+
restore-keys: ${{ runner.os }}-composer-
37+
38+
- name: Install dependencies
39+
run: |
40+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
41+
- name: Execute tests
42+
run: vendor/bin/phpunit --no-coverage

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
vendor
2-
composer.lock
1+
/vendor/
2+
.phpunit.result.cache
3+
composer.lock

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"php": "^7.2|^8.0"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": "^7.5|^8.0",
28-
"orchestra/testbench": "~3.8.0",
27+
"phpunit/phpunit": "^8.0|^9.0",
28+
"orchestra/testbench": "~3.9.0|^4.0|^5.0|^6.0|^7.0",
2929
"scrutinizer/ocular": "^1.5",
3030
"squizlabs/php_codesniffer": "~2.3"
3131
},

phpunit.xml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
>
1312
<testsuites>
1413
<testsuite name="Package Test Suite">

0 commit comments

Comments
 (0)