Skip to content

Commit

Permalink
Add workflow file for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1706 committed May 8, 2024
1 parent 49f586f commit 72d1dd0
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Tests

on:
push:
branches:
- master
- change/jiraProjectKey
pull_request:
branches:
- master

jobs:
mysql-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.1'
- php: '7.2'
- php: '7.3'
- php: '7.4'

name: PHP ${{ matrix.php }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap
coverage: none

- name: Get Composer Cache Directory
id: composer-cache
env:
PHP_VERSION: ${{ matrix.php }}
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

- name: Setup composer dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: |
php composer.phar install
- name: Run unit tests
run: |
vendor/bin/phpunit --verbose --stop-on-error

0 comments on commit 72d1dd0

Please sign in to comment.