Workflow file for this run
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 with SilverStripe and Redis | |
on: [push] | |
jobs: | |
continuous-integration: | |
name: Tests on PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-latest | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: true | |
MYSQL_DATABASE: SS_test | |
services: | |
mariadb: | |
image: mariadb:10.4 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: true | |
MYSQL_DATABASE: SS_test | |
ports: | |
- 3306:3306 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
strategy: | |
matrix: | |
php-versions: ['8.0', '8.1', '8.2'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP with composer | |
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, dom, fileinfo, mysql, libxml, xml, xmlwriter, dom, tokenizer, filter, json, phar, pcre, openssl, pdo, intl, curl | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
# With composer.lock use: | |
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | |
- name: Setup test environment | |
run: | | |
php -r "copy('.env.testing', '.env');" | |
- name: Test with phpunit | |
run: vendor/bin/phpunit tests/RedisCacheFactoryTest.php |