From fbf270156f529a9920551c6f499c52a11ca4a1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Kru=CC=88ss?= Date: Mon, 16 Jan 2023 15:33:05 -0800 Subject: [PATCH] tweak workflow formatting --- .editorconfig | 2 +- .github/workflows/release-drafter.yml | 8 ++- .github/workflows/tests.yml | 84 +++++++++++++++------------ 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/.editorconfig b/.editorconfig index f793370ea..d2ac9ed4c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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}] diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 30a547bb9..bdf32b952 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -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 }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6fcb48c3c..f1a64f903 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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