Skip to content

Commit

Permalink
Add GitHub action to run PHP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonXLF committed Sep 9, 2022
1 parent 9f4bb73 commit 2225dd3
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PHP Tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Write to config file
run: |
echo test-db-password = root > config.ini
- name: Run test suite
run: composer run-script test-lin

0 comments on commit 2225dd3

Please sign in to comment.