From fab47a6b9a91455f6db4386f2352f736513753d4 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 17 May 2023 07:43:37 +0200 Subject: [PATCH 1/2] :construction_worker: Add new github actions --- .github/FUNDING.yml | 2 ++ .github/ISSUE_TEMPLATE/config.yml | 11 ++++++ .github/dependabot.yml | 7 ++++ .github/workflows/coding-standards.yml | 2 +- .github/workflows/dependabot-auto-merge.yml | 32 +++++++++++++++++ .github/workflows/phpstan.yml | 38 +++++++++++++++++++++ 6 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dependabot-auto-merge.yml create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..2341d014 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +custom: https://laravel.cm/sponsors + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0633d86b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: Get Help + url: https://laravel.cm/forum/new-thread + about: If you need help with your project create a topic on our forum. + - name: Bug Report + url: https://github.com/laravelcm/issues + about: 'For projects issues, suggest changes on our issues repository.' + - name: Feature Request + url: https://github.com/laravelcm/laravel.cm/discussions/new?category=ideas + about: Share ideas for new features diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..04709f23 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index f487cb0c..37ebb539 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -1,4 +1,4 @@ -name: fix code styling +name: Check & fix styling on: [push, pull_request] diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..b26d1207 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -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/fetch-metadata@v1.4.0 + 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}} diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 00000000..c340b4cb --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,38 @@ +name: PHPStan + +on: + push: + pull_request: + +jobs: + phpstan: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [8.2] + laravel: [9.*] + dependency-version: [prefer-stable] + include: + - laravel: 9.* + testbench: 7.* + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} + steps: + - uses: actions/checkout@v3 + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, pdo, pdo_sqlite + coverage: none + - 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 + - name: Run PHPStan + run: composer stan From e74d3f4db398642c80d6caa189eed9aebd702e53 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 17 May 2023 07:51:13 +0200 Subject: [PATCH 2/2] :green_heart: Update phpstan CI --- .github/workflows/phpstan.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index c340b4cb..334afa19 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -15,7 +15,6 @@ jobs: dependency-version: [prefer-stable] include: - laravel: 9.* - testbench: 7.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - uses: actions/checkout@v3 @@ -28,11 +27,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: mbstring, pdo, pdo_sqlite + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite coverage: none - 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 + run: composer install --prefer-dist --no-interaction - name: Run PHPStan run: composer stan