Skip to content

Commit

Permalink
Upgraded for Laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfox committed Feb 9, 2022
1 parent 7929c4b commit d5c9a61
Show file tree
Hide file tree
Showing 37 changed files with 213 additions and 231 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/coverage.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: dependabot-auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
36 changes: 15 additions & 21 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,21 @@ name: Check & fix styling
on: [push]

jobs:
style:
runs-on: ubuntu-latest
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist.php --allow-risky=yes

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
33 changes: 0 additions & 33 deletions .github/workflows/psalm.yml

This file was deleted.

42 changes: 23 additions & 19 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Tests
name: run-tests

on: [push, pull_request]
on:
push:
pull_request:
branches: [main]

jobs:
test:
Expand All @@ -9,39 +12,40 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [ 7.3, 7.4, 8.0 ]
laravel: [ ^8.0 ]
dependency-version: [ prefer-lowest, prefer-stable ]
php: [8.1, 8.0, 7.4]
laravel: [9.*, 8.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: ^8.0
testbench: ^6.0
- laravel: 9.*
testbench: ^7.0
- laravel: 8.*
testbench: ^6.24.1
exclude:
- { php: 8.0, laravel: ^8.0, dependency-version: prefer-lowest }
- { php: 8.0, laravel: ^8.0, os: windows-latest }
- laravel: 9.*
php: 7.4

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ coverage
.phpunit.result.cache
.idea
.php_cs.cache
.php_cs

1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.2","version":"3.6.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Queue.php":2625587104,"src\/Authenticator\/OidcAuthenticator.php":2032516676,"src\/Authenticator\/OAuthAuthenticator.php":1447640959,"src\/RequestGenerator.php":1121080602,"src\/Job.php":3603980464,"src\/CloudTask.php":533701343,"src\/Connectors\/CloudTasksConnector.php":3432587827,"src\/Connectors\/AppEngineConnector.php":3734060154,"src\/Dispatcher.php":3915431401,"src\/Middlewares\/AppEngine.php":1517634987,"src\/Middlewares\/ConfigureUrlGenerator.php":748842487,"src\/Middlewares\/CloudTasks.php":1498758896,"src\/CloudTaskServiceProvider.php":996743426,"src\/TaskFactory.php":3650286360,"src\/Events\/TaskStarted.php":1274689628,"src\/Events\/TaskFinished.php":3052684979,"src\/HttpRequestAuthenticator.php":3327767589,"src\/GoogleCloudTasks.php":645478948,"src\/Dispatcher\/AppEngineDispatcher.php":2382909916,"src\/Dispatcher\/HttpDispatcher.php":3652314544,"src\/ConnectionRetrieval.php":60208731,"src\/DispatcherFactory.php":2343590182,"src\/Controllers\/CloudTasksController.php":250532409,"src\/CloudTask\/HttpCloudTask.php":878207021,"src\/CloudTask\/AppEngineTask.php":1505756853,"src\/Factories\/CloudTaskClientFactory.php":3730736349,"tests\/JobDispatchTest.php":1519407150,"tests\/Dummy\/JobUrlGeneration.php":635104922,"tests\/Dummy\/JobDummy.php":160650759,"tests\/ServiceProviderTest.php":1669434645,"tests\/AppEngineJobProcessingTest.php":965902427,"tests\/HttpTasksJobProcessingTest.php":1030394687,"tests\/database\/migrations\/create_failed_jobs_table.php":2295282480}}
17 changes: 10 additions & 7 deletions .php_cs → .php_cs.dist.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -13,14 +10,14 @@
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
Expand All @@ -29,9 +26,15 @@
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
15 changes: 0 additions & 15 deletions .scrutinizer.yml

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Google Cloud Tasks Queue Driver for Laravel

[![Latest Version on Packagist](https://img.shields.io/packagist/v/tradecoverexchange/google-cloud-tasks-laravel.svg?style=flat-square)](https://packagist.org/packages/tradecoverexchange/google-cloud-tasks-laravel)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/tradecoverexchange/google-cloud-tasks-laravel/Tests?label=tests)](https://github.com/tradecoverexchange/google-cloud-tasks-laravel/actions?query=workflow%3ATests+branch%3Amaster)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/tradecoverexchange/google-cloud-tasks-laravel/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/tradecoverexchange/google-cloud-tasks-laravel/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/tradecoverexchange/google-cloud-tasks-laravel/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/tradecoverexchange/google-cloud-tasks-laravel/?branch=master)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/tradecoverexchange/google-cloud-tasks-laravel/run-tests?label=tests)](https://github.com/tradecoverexchange/google-cloud-tasks-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/tradecoverexchange/google-cloud-tasks-laravel/Check%20&%20fix%20styling?label=code%20style)](https://github.com/tradecoverexchange/google-cloud-tasks-laravel/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/tradecoverexchange/google-cloud-tasks-laravel.svg?style=flat-square)](https://packagist.org/packages/tradecoverexchange/google-cloud-tasks-laravel)

A Laravel Queue driver to interact with [Google Cloud Tasks](https://cloud.google.com/tasks).

## Installation

Requires Laravel 8 and PHP 7.3 as a minimum.
Requires Laravel 8 and PHP 7.4 as a minimum.

You can install the package via composer:

Expand Down
Loading

0 comments on commit d5c9a61

Please sign in to comment.