-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from irsyadulibad/dev
add: github workflows for testing
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |