Skip to content

Commit

Permalink
added GitHub Actions for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petrparolek committed Jun 18, 2020
1 parent cc486db commit da964c5
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']

fail-fast: false

name: PHP ${{ matrix.php }} tests
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring, xml, tokenizer
coverage: none

- run: mkdir -p tests/tmp
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
- run: composer install --no-interaction --prefer-source
- run: vendor/bin/tester tests -s -C
- if: failure()
uses: actions/upload-artifact@v1
with:
name: output
path: tests/PdfResponse/output

lowest_dependencies:
name: Lowest Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.1
extensions: json, mbstring, xml, tokenizer
coverage: none

- run: mkdir -p tests/tmp
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
- run: composer update --no-interaction --prefer-dist --prefer-lowest --prefer-stable
- run: vendor/bin/tester tests -s -C


code_coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.4
extensions: json, mbstring, xml, tokenizer
coverage: none

- run: mkdir -p tests/tmp
- run: cat $(php -r 'echo php_ini_loaded_file() . " " . str_replace("\n", " ", str_replace(",", "", php_ini_scanned_files()));') > tests/tmp/php.ino
- run: composer install --no-progress --prefer-dist
- run: wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- run: vendor/bin/tester -p phpdbg tests -s -c tests/tmp/php.ino --coverage ./coverage.xml --coverage-src ./src
- run: php coveralls.phar --verbose --config tests/.coveralls.yml
4 changes: 4 additions & 0 deletions tests/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: coverage.xml
json_path: coverage.json

0 comments on commit da964c5

Please sign in to comment.