Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Harden GHA workflows #891

Merged
merged 1 commit into from
Dec 31, 2024
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
8 changes: 5 additions & 3 deletions .github/workflows/CI-Experimental.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI Experimental

permissions: read-all
permissions: {}

on:
push:
Expand All @@ -19,8 +19,10 @@ jobs:
- 6379/tcp
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: shivammathur/[email protected]
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: '8.5'
extensions: mbstring, redis, apcu
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

permissions: read-all
permissions: {}

on:
push:
Expand All @@ -12,6 +12,8 @@ jobs:
tests:
name: Tests on PHP ${{ matrix.php }} ${{ matrix.dependencies }}
runs-on: ubuntu-24.04
permissions:
contents: read
services:
redis:
image: redis
Expand All @@ -23,8 +25,10 @@ jobs:
dependencies: ['--ignore-platform-req=php', '--prefer-lowest --prefer-stable --ignore-platform-req=php']
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: shivammathur/[email protected]
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: ${{ matrix.php }}
extensions: mbstring, redis, apcu
Expand All @@ -41,9 +45,9 @@ jobs:
env:
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Upload coverage to Codecov
uses: codecov/[email protected]
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
with:
file: ./coverage.xml
files: ./coverage.xml
mutation_testing:
name: Mutation testing
runs-on: ubuntu-24.04
Expand All @@ -54,8 +58,10 @@ jobs:
- 6379/tcp
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: shivammathur/[email protected]
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: '8.2'
extensions: mbstring, redis, apcu
Expand All @@ -69,7 +75,7 @@ jobs:
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Archive report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: Infection report
path: infection.log
Expand All @@ -81,7 +87,9 @@ jobs:
php: ['8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Start stack
Expand All @@ -104,8 +112,10 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: shivammathur/[email protected]
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: '8.2'
extensions: mbstring, redis, apcu
Expand All @@ -123,7 +133,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Composer Require Checker
Expand All @@ -137,7 +149,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# Disable (temporarily) CI check with Roave BC check
# See https://github.com/Nyholm/roave-bc-check-docker/issues/32
Expand All @@ -150,7 +164,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install nix
uses: cachix/install-nix-action@v30
with:
Expand Down
Loading