Skip to content

Added Cache test

Added Cache test #17

Workflow file for this run

name: Test And Release
on:
push:
branches: [master, staging]
pull_request:
branches: [master, staging]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0, 8.1]
database: [mysql, mariadb, sqlite]
release: [stable, lowest]
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 3306
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 3306
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/cache@v3
with:
path: ~/.cache/composer/files
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: pecl
extensions: bcmath, ctype, json, mbstring, openssl, pdo, pdo_${{ matrix.database }}, tokenizer, xml
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }}
- run: |
composer test
env:
DATABASE: ${{ matrix.database }}
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
MARIADB_PORT: ${{ job.services.mariadb.ports[3306] }}
versioning:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: paulhatch/[email protected]
id: semver
- name: Publish Github Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.semver.outputs.version }}
draft: false