-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee80e94
commit 97df037
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
test: | ||
name: Test PHP ${{ matrix.php-version }} | ||
|
||
runs-on: | ||
group: default | ||
|
||
strategy: | ||
matrix: | ||
php-version: ['8.1', '8.2'] | ||
|
||
services: | ||
redis: | ||
image: bitnami/redis:6.2.4-debian-10-r35 | ||
ports: | ||
- 6379:6379 | ||
env: | ||
ALLOW_EMPTY_PASSWORD: 'yes' | ||
options: >- | ||
--health-cmd "redis-cli -p 6379 ping" | ||
--health-start-period 5s | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: ${{ matrix.php-version }} | ||
php_extensions: "redis-5.3.7" | ||
|
||
- name: PHPUnit Tests | ||
uses: php-actions/phpunit@v3 | ||
with: | ||
version: 9.5.26 | ||
php_version: ${{ matrix.php-version }} | ||
php_extensions: "xdebug redis-5.3.7" | ||
bootstrap: vendor/autoload.php | ||
configuration: phpunit.xml | ||
coverage_clover: "coverage/clover.xml" | ||
args: --coverage-text | ||
env: | ||
XDEBUG_MODE: coverage | ||
REDIS_HOST: 127.0.0.1 | ||
REDIS_PORT: 6379 | ||
|
||
- name: Run codacy-coverage-reporter | ||
uses: codacy/codacy-coverage-reporter-action@v1 | ||
with: | ||
api-token: ${{ secrets.CODACY_API_TOKEN }} | ||
coverage-reports: "coverage/clover.xml" | ||
|
||
- name: Dump docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 | ||
|
||
|
||
unit-test-ready: | ||
needs: [ test ] | ||
runs-on: | ||
group: default | ||
name: "Testing Ready" | ||
steps: | ||
- name: All tests passed | ||
run: echo "All matrix jobs succeeded" |