Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ updates:
open-pull-requests-limit: 5
labels:
- dependencies
cooldown:
default-days: 7

- package-ecosystem: github-actions
directory: /
Expand All @@ -22,3 +24,5 @@ updates:
open-pull-requests-limit: 5
labels:
- dependencies
cooldown:
default-days: 7
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,45 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
name: Relevant changes
runs-on: ubuntu-latest

outputs:
run: ${{ steps.filter.outputs.run }}

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
fetch-depth: 0

- name: Detect relevant changes
id: filter
env:
EVENT_NAME: ${{ github.event_name }}
BEFORE_SHA: ${{ github.event.before }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
BASE="$BASE_SHA"
elif [ "$BEFORE_SHA" = "0000000000000000000000000000000000000000" ]; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
else
BASE="$BEFORE_SHA"
fi

if git diff --quiet "$BASE" "$GITHUB_SHA" -- \
src tests config examples composer.json testo.php psalm.xml \
rector.php .php-cs-fixer.php infection.json5 \
.github/workflows/build.yml; then
echo "run=false" >> "$GITHUB_OUTPUT"
else
echo "run=true" >> "$GITHUB_OUTPUT"
fi

build:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,6 +94,8 @@ jobs:

prefer-lowest:
name: Prefer lowest
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -86,6 +127,8 @@ jobs:

coverage:
name: Coverage & Mutation
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -120,6 +163,8 @@ jobs:

compatibility:
name: Backward compatibility
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
name: Publish GitHub release
runs-on: ubuntu-latest
permissions:
# creating a Release object is a write to the repository
contents: write
contents: write # Needed to create the GitHub release

steps:
- name: Checkout
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,49 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
name: Relevant changes
runs-on: ubuntu-latest

outputs:
run: ${{ steps.filter.outputs.run }}

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
fetch-depth: 0

- name: Detect relevant changes
id: filter
env:
EVENT_NAME: ${{ github.event_name }}
BEFORE_SHA: ${{ github.event.before }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
BASE="$BASE_SHA"
elif [ "$BEFORE_SHA" = "0000000000000000000000000000000000000000" ]; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
else
BASE="$BEFORE_SHA"
fi

if git diff --quiet "$BASE" "$GITHUB_SHA" -- \
src tests config examples composer.json testo.php psalm.xml \
rector.php .php-cs-fixer.php infection.json5 \
.github/workflows/static-analysis.yml; then
echo "run=false" >> "$GITHUB_OUTPUT"
else
echo "run=true" >> "$GITHUB_OUTPUT"
fi

psalm:
name: Psalm
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
runs-on: ubuntu-latest

steps:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: GitHub Actions security

on:
pull_request:
paths: &paths
- '.github/**/*.yml'
- '.github/**/*.yaml'
push:
branches:
- master
paths: *paths

permissions:
contents: read

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

jobs:
zizmor:
name: zizmor
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Audit GitHub Actions
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
with:
advanced-security: false
annotations: true
online-audits: false
persona: auditor
version: 1.25.2
Loading