Skip to content

Commit

Permalink
tweak workflow formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss committed Jan 16, 2023
1 parent 24630fb commit fbf2701
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
trim_trailing_whitespace = true
max_line_length = 120

[*.{md,yml}]
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main

jobs:

update_release_draft:

name: Update release draft
runs-on: ubuntu-latest

steps:
# Drafts your next Release notes as Pull Requests are merged into "master"

- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84 changes: 48 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,58 @@ on:
jobs:

predis:
name: PHP ${{ matrix.php-versions }} (Redis ${{ matrix.redis-versions }})
name: PHP ${{ matrix.php }} (Redis ${{ matrix.redis }})
runs-on: ubuntu-latest

services:
redis:
image: redis:${{ matrix.redis-versions }}
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
redis-versions: ['3', '4', '5', '6', '7']
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
redis:
- 3
- 4
- 5
- 6
- 7

services:
redis:
image: redis:${{ matrix.redis }}
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 6379:6379

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer and extensions
with:
php-version: ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2

- name: Get Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: composer install --no-progress --prefer-dist --optimize-autoloader $(if [ "$PHP_VERSION" == "8.0" ]; then echo "--ignore-platform-reqs"; fi;)

- name: Test with PHPUnit
run: vendor/bin/phpunit

- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP with Composer and extensions
with:
php-version: ${{ matrix.php }}
uses: shivammathur/setup-php@v2

- name: Get Composer cache directory
id: composer-cache
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: tests-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: tests-php-${{ matrix.php }}-composer

- name: Install Composer dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: composer install --ansi --no-progress --prefer-dist $(if [ "$PHP_VERSION" == "8.0" ]; then echo "--ignore-platform-reqs"; fi;)

- name: Run PHPUnit tests
run: vendor/bin/phpunit

0 comments on commit fbf2701

Please sign in to comment.