fixup! Tidy up front-end #1087
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
name: Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test on PHP ${{ matrix.php_version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php_version: ["7.4", "8.2", "8.3"] | |
services: | |
mariadb: | |
image: mariadb:10.5 | |
ports: | |
- 3306:3306 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: twfy_test | |
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | |
redis: | |
image: bitnami/redis | |
ports: | |
- 6379:6379 | |
env: | |
REDIS_PASSWORD: password | |
options: >- | |
--health-cmd "redis-cli -a password ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis-sentinel: | |
image: bitnami/redis-sentinel | |
env: | |
REDIS_MASTER_HOST: redis | |
REDIS_MASTER_SET: mymaster | |
REDIS_MASTER_PASSWORD: password | |
REDIS_SENTINEL_QUORUM: 1 | |
ports: | |
- 26379:26379 | |
options: >- | |
--health-cmd "redis-cli -p 26379 ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
# - name: Stop any running MySQL | |
# run: sudo systemctl stop mysql.service | |
# - uses: chhsiung/github-actions-mysql@0f348ad54f14038adafed5914b5ce775806768ab | |
# with: | |
# rootPassword: 'password' | |
# sqlMode: 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' | |
- uses: niden/actions-memcached@v7 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php_version }} | |
extensions: memcached | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(php composer.phar config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-php-composer- | |
- name: Verify MariaDB connection | |
run: | | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do | |
sleep 1 | |
done | |
- name: Set up database and code | |
run: | | |
mysql -h 127.0.0.1 -u root -ppassword twfy_test < db/schema.sql | |
php composer.phar install --no-interaction | |
- name: Run tests | |
env: | |
TWFY_TEST_DB_HOST: "127.0.0.1" | |
TWFY_TEST_DB_USER: "root" | |
TWFY_TEST_DB_PASS: "password" | |
TWFY_TEST_DB_NAME: "twfy_test" | |
run: | | |
mkdir -p build/logs | |
vendor/bin/phpunit --exclude-group xapian | |
- name: Afterwards | |
if: matrix.php_version == '7.4' | |
run: | | |
wget https://scrutinizer-ci.com/ocular.phar | |
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml |