diff options
author | Davey Shafik <davey@php.net> | 2020-10-26 20:34:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-26 20:34:19 -0700 |
commit | 968b1da9e1d3c172e218dfb57af5a5c01e85eb95 (patch) | |
tree | 55572af80c6b29bd2f05c44977aaf6e86042c3d5 | |
parent | 534f406552a2e5999c964c15b8524c958b193854 (diff) | |
download | php7-mysql-shim-968b1da9e1d3c172e218dfb57af5a5c01e85eb95.zip php7-mysql-shim-968b1da9e1d3c172e218dfb57af5a5c01e85eb95.tar.gz php7-mysql-shim-968b1da9e1d3c172e218dfb57af5a5c01e85eb95.tar.bz2 |
Add phpunit workflow
-rw-r--r-- | .github/workflows/phpunit.yaml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml new file mode 100644 index 0000000..094e03c --- /dev/null +++ b/.github/workflows/phpunit.yaml @@ -0,0 +1,47 @@ +name: Testing php7-mysql-shim +on: [push, pull_request] +jobs: + lib: + name: php7-mysql-shim (PHP ${{ matrix.php-versions }}) + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: false + MYSQL_ROOT_PASSWORD: testing + MYSQL_DATABASE: testing + ports: + - 3306/tcp + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + strategy: + fail-fast: false + matrix: + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql + coverage: xdebug #optional + - name: Start mysql service + run: sudo /etc/init.d/mysql start + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + # Use composer.json for key, if composer.lock is not committed. + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + run: | + composer install --no-progress --prefer-dist --optimize-autoloader + - name: Run Tests + run: php bin/phpunit --coverage-text |