Issue #34: Refactored warmer plug-ins to use constructor injection: #9
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
# Main GitHub Actions file for Omnipedia. | |
# | |
# @see https://github.com/shivammathur/setup-php | |
# | |
# @see https://github.com/shivammathur/setup-php/blob/master/examples/symfony-mysql.yml | |
# | |
# @see https://github.com/mglaman/whiskeydex/blob/main/.github/workflows/main.yml | |
name: Main | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
env: | |
# shivammathur/setup-php | |
PHP_EXTENSIONS: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, pdo_sqlite, bcmath, gd, exif, iconv | |
PHP_VERSION: 8.1 | |
jobs: | |
phpunit: | |
name: PHPUnit | |
runs-on: ubuntu-latest | |
# Docs: https://docs.github.com/en/actions/using-containerized-services | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_ROOT_PASSWORD: db | |
MYSQL_DATABASE: db | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
extensions: ${{ env.PHP_EXTENSIONS }} | |
coverage: none | |
tools: composer:v2 | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
# Use composer.json for key, if composer.lock is not committed. | |
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Run PHP development web server for functional tests | |
run: "cd web && php -S 127.0.0.1:8080 .ht.router.php &" | |
- name: Run tests | |
run: php web/core/scripts/run-tests.sh --sqlite ../test.sqlite --dburl mysql://root:[email protected]:${{ job.services.mysql.ports['3306'] }}/db --suppress-deprecations --color --url http://127.0.0.1:8080 --verbose omnipedia |