Skip to content

Merge pull request #6 from DavidGoodwin/test-build-refresh #40

Merge pull request #6 from DavidGoodwin/test-build-refresh

Merge pull request #6 from DavidGoodwin/test-build-refresh #40

Workflow file for this run

name: GitHub Build
on:
push:
jobs:
sanity-check:
runs-on: ubuntu-24.04
env:
key: cache-v1
extensions: apc, redis, apcu, memcache, memcached
steps:
- uses: actions/checkout@v3
- name: Setup cache environment for ${{ matrix.php-versions }}
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: 8.0
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP {{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer
extensions: ${{ env.extensions }}
ini-values: apc.enable_cli=1
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: format check etc
run: composer check-format
- name: phpstan
run: composer phpstan
- name: psalm
run: composer psalm
unit-test:
runs-on: ubuntu-24.04
needs: [sanity-check]
env:
key: cache-v1
extensions: apc, redis, apcu, memcache, memcached
services:
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
memcache:
image: memcached
ports:
- 11211:11211
strategy:
matrix:
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
steps:
- uses: actions/checkout@v3
- name: Setup cache environment for ${{ matrix.php-versions }}
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP {{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer
extensions: ${{ env.extensions }}
ini-values: apc.enable_cli=1
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: psalm
run: composer psalm
- name: Run test suite
run: composer test
env:
REDIS_HOST: localhost
MEMCACHE_HOST: localhost