Skip to content

Commit b74d829

Browse files
authored
Merge pull request #278 from azmeuk/unit-tests
unit tests with GHA
2 parents 4ef5208 + 47506dd commit b74d829

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: build
3+
4+
on: [push, pull_request]
5+
6+
env:
7+
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
8+
9+
jobs:
10+
phpunit:
11+
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest]
17+
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Install PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
- name: Get composer cache directory
27+
id: composer-cache
28+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
29+
- name: Cache composer dependencies
30+
uses: actions/cache@v1
31+
with:
32+
path: ${{ steps.composer-cache.outputs.dir }}
33+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: ${{ runner.os }}-composer-
35+
- name: Install dependencies
36+
run: composer update $DEFAULT_COMPOSER_FLAGS
37+
- name: Run unit tests
38+
run: vendor/bin/phpunit --verbose --colors=always tests

0 commit comments

Comments
 (0)