Skip to content

Commit

Permalink
Merge pull request #26 from irsyadulibad/dev
Browse files Browse the repository at this point in the history
add: github workflows for testing
  • Loading branch information
irsyadulibad authored May 3, 2022
2 parents 2a3f13a + 15ee76d commit 7226f98
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: Testing (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: tests_datatables
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, mysql, xml, json, curl
coverage: none

- name: Setup MySQL
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -h127.0.0.1 -e 'CREATE DATABASE tests_datatables;'
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Testing with PHPUnit
run: vendor/bin/phpunit --verbose

0 comments on commit 7226f98

Please sign in to comment.