Skip to content

Commit 2fad892

Browse files
committed
Add Github actions integration
1 parent b6fb150 commit 2fad892

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/phpunit.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "PHPUnit tests"
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
phpunit:
8+
name: "PHPUnit tests"
9+
10+
runs-on: ${{ matrix.operating-system }}
11+
12+
strategy:
13+
matrix:
14+
dependencies:
15+
- "lowest"
16+
- "highest"
17+
php-version:
18+
- "7.4"
19+
- "8.0"
20+
operating-system:
21+
- "ubuntu-latest"
22+
23+
steps:
24+
- name: "Checkout"
25+
uses: "actions/checkout@v2"
26+
27+
- name: "Install PHP"
28+
uses: "shivammathur/setup-php@v2"
29+
with:
30+
coverage: "xdebug"
31+
php-version: "${{ matrix.php-version }}"
32+
ini-values: memory_limit=-1
33+
tools: composer:v2, cs2pr
34+
35+
- name: "Cache dependencies"
36+
uses: "actions/cache@v2"
37+
with:
38+
path: |
39+
~/.composer/cache
40+
vendor
41+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
42+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
43+
44+
- name: "Install lowest dependencies"
45+
if: ${{ matrix.dependencies == 'lowest' }}
46+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
47+
48+
- name: "Install highest dependencies"
49+
if: ${{ matrix.dependencies == 'highest' }}
50+
run: "composer update --no-interaction --no-progress --no-suggest"
51+
52+
- name: "Install locked dependencies"
53+
if: ${{ matrix.dependencies == 'locked' }}
54+
run: "composer install --no-interaction --no-progress --no-suggest"
55+
56+
- name: "Tests"
57+
run: "XDEBUG_MODE=coverage vendor/bin/phpunit"

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"minimum-stability": "stable",
1313
"require": {
1414
"php": "^7.4|^8.0",
15-
"lisachenko/z-engine": "^0.7|^0.9"
15+
"lisachenko/z-engine": "^0.8.1|^0.9.1"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "^8.5|^9.5"
18+
"phpunit/phpunit": "^8.5.15|^9.5.5"
1919
},
2020
"autoload": {
2121
"psr-4": {

0 commit comments

Comments
 (0)