Skip to content

Commit da964c5

Browse files
committed
added GitHub Actions for tests
1 parent cc486db commit da964c5

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php: ['7.1', '7.2', '7.3', '7.4']
11+
12+
fail-fast: false
13+
14+
name: PHP ${{ matrix.php }} tests
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: shivammathur/setup-php@v1
18+
with:
19+
php-version: ${{ matrix.php }}
20+
extensions: json, mbstring, xml, tokenizer
21+
coverage: none
22+
23+
- run: mkdir -p tests/tmp
24+
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
25+
- run: composer install --no-interaction --prefer-source
26+
- run: vendor/bin/tester tests -s -C
27+
- if: failure()
28+
uses: actions/upload-artifact@v1
29+
with:
30+
name: output
31+
path: tests/PdfResponse/output
32+
33+
lowest_dependencies:
34+
name: Lowest Dependencies
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: shivammathur/setup-php@v1
39+
with:
40+
php-version: 7.1
41+
extensions: json, mbstring, xml, tokenizer
42+
coverage: none
43+
44+
- run: mkdir -p tests/tmp
45+
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
46+
- run: composer update --no-interaction --prefer-dist --prefer-lowest --prefer-stable
47+
- run: vendor/bin/tester tests -s -C
48+
49+
50+
code_coverage:
51+
name: Code Coverage
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: shivammathur/setup-php@v1
56+
with:
57+
php-version: 7.4
58+
extensions: json, mbstring, xml, tokenizer
59+
coverage: none
60+
61+
- run: mkdir -p tests/tmp
62+
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
63+
- run: composer install --no-progress --prefer-dist
64+
- run: wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
65+
- run: vendor/bin/tester -p phpdbg tests -s -c tests/tmp/php.ino --coverage ./coverage.xml --coverage-src ./src
66+
- run: php coveralls.phar --verbose --config tests/.coveralls.yml

tests/.coveralls.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# for php-coveralls
2+
service_name: travis-ci
3+
coverage_clover: coverage.xml
4+
json_path: coverage.json

0 commit comments

Comments
 (0)