Skip to content

Commit

Permalink
migrate testing from Travis to Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-horvath committed Jan 18, 2022
1 parent 7a4fb4f commit 1a724c3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 18 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on: [push, pull_request]

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug

- name: Setup MySQL
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '5.6'

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-
- name: Install dependencies
run: composer install -o --no-progress

- name: Set up database
run: |
cp config/db-config.sample.php config/db-config.php
mysql -uroot -h127.0.0.1 -e 'CREATE DATABASE labs;'
cat vendor/clearbooks/labs-schema/sql/*.sql | mysql -uroot -h127.0.0.1 labs
- name: Run tests
run: ./vendor/bin/phpunit -c phpunit.xml
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

0 comments on commit 1a724c3

Please sign in to comment.