Skip to content

Commit

Permalink
[CI] cache security checker (#11407)
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaviano authored Jan 30, 2025
1 parent 03e961d commit 6d24fe2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set cache key (monthly refresh)
run: echo "CACHE_MONTH=$(date +'%Y-%m')" >> $GITHUB_ENV

- name: Cache composer
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -142,15 +145,25 @@ jobs:
- name: PHPStan - PHP Static Analysis Tool
run: make phpstan

- name: Local PHP Security Checker
- name: Cache Local PHP Security Checker
id: cache-security-checker
uses: actions/cache@v4
with:
path: ./local-php-security-checker
key: local-php-security-checker-${{ runner.os }}-${{ env.CACHE_MONTH }}
restore-keys: |
local-php-security-checker-${{ runner.os }}-
- name: Download Local PHP Security Checker if not cached
if: steps.cache-security-checker.outputs.cache-hit != 'true'
run: |-
lastReleaseInfo=$(curl --silent "https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest")
securityCheckVersion=$(echo "${lastReleaseInfo}" | grep '"tag_name":' | sed -E 's/.*"v(.+)",/\1/')
curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v${securityCheckVersion}/local-php-security-checker_linux_$(dpkg --print-architecture) --output ./local-php-security-checker
chmod +x ./local-php-security-checker
./local-php-security-checker
- name: Run Local PHP Security Checker
run: ./local-php-security-checker

phpunit:
name: PHPUnit
Expand Down

0 comments on commit 6d24fe2

Please sign in to comment.