Skip to content

Run tests

Run tests #38

Workflow file for this run

name: Run tests
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
jobs:
test-php:
name: Test on php ${{ matrix.php-version }} (${{ matrix.php-extensions }}) and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"]
php-extensions: ["dbase", ""]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Use php ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
coverage: xdebug
- name: Cache module
uses: actions/cache@v2
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: composer install
- name: Run php tests
run: composer run phpunit
- name: Run php examples
run: |
php -f examples/create_shapefile.php
php -f examples/read_point.php > /dev/null
php -f examples/read_polygon.php > /dev/null
- name: Send coverage
uses: codecov/codecov-action@v1
with:
flags: unit-${{ matrix.php-version }}-${{ matrix.php-extensions }}-${{ matrix.os }}
name: phpunit-${{ matrix.php-version }}-${{ matrix.php-extensions }}-${{ matrix.os }}
- name: Send coverage to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
# Upload can fail on forks
continue-on-error: true
with:
cli-args: "--format=php-clover build/logs/clover.xml"