Skip to content

Commit

Permalink
chore: Harden GHA workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSuisse committed Dec 31, 2024
1 parent ae5a38a commit e59b760
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
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/setup-php@2.32.0
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/setup-php@2.32.0
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/codecov-action@v5.1.2
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/setup-php@2.32.0
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/setup-php@2.32.0
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

0 comments on commit e59b760

Please sign in to comment.