Skip to content

Commit

Permalink
Update GitHub Actions: Use `typisttech/.github/tree/main/.github/work…
Browse files Browse the repository at this point in the history
…flows` v2.5.0 (#17)

* GitHib Actions: Use `typisttech/.github/.github/workflows/php-matrix.yml@v2`

* GitHib Actions: Use `typisttech/.github/.github/workflows/pint.yml@v2`

* GitHib Actions: Use `typisttech/.github/.github/workflows/dependabot-auto-merge.yml@v2`

* GitHib Actions: Add `Composer Audit` workflow

* GitHib Actions: Add `Composer Normalize` workflow

* GitHib Actions: Add `Release Drafter` workflow
  • Loading branch information
tangrufus authored Jan 18, 2025
1 parent 71bb3dd commit bac75cc
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 41 deletions.
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
23 changes: 0 additions & 23 deletions .github/workflows/auto-commit.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/composer-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Composer Audit

on:
workflow_dispatch:
schedule:
- cron: '23 3 * * 1' # Weekly on Monday
pull_request:
branches:
- main
paths:
- .github/workflows/composer-audit.yml
- composer.*
push:
branches:
- main
paths:
- .github/workflows/composer-audit.yml
- composer.*

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
composer-audit:
uses: typisttech/.github/.github/workflows/composer-audit.yml@v2
permissions:
contents: read
23 changes: 23 additions & 0 deletions .github/workflows/composer-normalize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Composer Normalize

on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/composer-normalize.yml
- composer.*

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
composer-normalize:
uses: typisttech/.github/.github/workflows/composer-normalize.yml@v2
permissions:
contents: read
secrets: inherit
9 changes: 5 additions & 4 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Taken from https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
# and https://github.com/dependabot/fetch-metadata/blob/06ea45a2e4582d87b11f03c7ce596ae3261f39f6/README.md?plain=1#L133-L160
name: Dependabot Auto-merge

on: pull_request
on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand All @@ -15,7 +16,7 @@ jobs:
permissions:
contents: write
pull-requests: write
uses: typisttech/.github/.github/workflows/dependabot-auto-merge.yml@v1
uses: typisttech/.github/.github/workflows/dependabot-auto-merge.yml@v2
with:
minor: true
patch: true
27 changes: 27 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pint

on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/pint.yml
- '**.php'
- composer.*
- pint.json

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
pint:
uses: typisttech/.github/.github/workflows/pint.yml@v2
permissions:
contents: read
with:
php-version: '8.4'
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Drafter

on:
workflow_dispatch:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions: {}

jobs:
release-drafter:
uses: typisttech/.github/.github/workflows/release-drafter.yml@v2
permissions:
contents: write
pull-requests: read
29 changes: 15 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,26 @@ concurrency:
permissions: {}

jobs:
php-matrix:
uses: typisttech/.github/.github/workflows/php-matrix.yml@v2
permissions:
contents: read

pest:
runs-on: ubuntu-latest
needs: php-matrix
strategy:
matrix:
php: ['8.3', '8.4']
prefer: [--prefer-lowest, --prefer-stable]
php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
dependency-versions: [lowest, highest]
coverage: [none]
exclude:
- php: '8.4'
prefer: --prefer-stable
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: none
include:
- php: '8.4'
prefer: --prefer-stable
- php: ${{ needs.php-matrix.outputs.highest }}
dependency-versions: highest
coverage: xdebug
steps:
- uses: actions/checkout@v4
Expand All @@ -41,15 +47,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
- uses: ramsey/composer-install@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.json') }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.prefer }}-

- run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ matrix.prefer }}
dependency-versions: ${{ matrix.dependency-versions }}
composer-options: --no-audit --optimize-autoloader

- run: composer pest:unit -- --ci --coverage-clover coverage.xml
if: ${{ matrix.coverage == 'xdebug' }}
Expand Down

0 comments on commit bac75cc

Please sign in to comment.