Skip to content

Conversation

@Glenn-Ewing
Copy link
Contributor

This PR adds Psalm PHP static analysis tooling and integrates it into CI/CD.

Changes

  • Add vimeo/psalm to require-dev dependencies
  • Add psalm.xml configuration file
  • Add composer psalm script
  • Add CodeQL workflow for automated Psalm scanning in CI/CD

Verification

  • ✅ All configurations validated
  • ✅ PHP version compatibility confirmed
  • ✅ Psalm executes successfully
  • ✅ No breaking changes introduced

The CI/CD workflow will run Psalm analysis across PHP versions 8.0, 8.1, 8.2, 8.3 (matching the PHP 8.0+ requirement) and upload results to GitHub Security.

- Add vimeo/psalm to require-dev dependencies
- Add psalm.xml configuration file
- Add composer psalm script
- Add CodeQL workflow for automated Psalm scanning in CI/CD
@Glenn-Ewing Glenn-Ewing changed the title Add Psalm PHP static analysis and CI/CD integration SEC25-120: Add Psalm PHP static analysis and CI/CD integration Jan 13, 2026
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

- Generate new composer.lock with compatible dependency versions (using existing platform config)
- Revert to reusable workflow with composer install for reproducible builds
CoreyRDean
CoreyRDean previously approved these changes Jan 13, 2026
Copy link
Member

@joshmcrae joshmcrae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we can avoid confusing issues resulting from cached vendor files. See below.

uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend including the PHP version in the key as the PHP version can influence which packages are installed. This leads to very confusing test failures when the loaded libraries (cached) use unavailable language features.

${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, good call. That said, this is pulled from: https://github.com/tithely/php-workflows/blob/main/.github/workflows/codeql.yml (which I don't have access to change) so I'll update this inline version, but can't change the source.

@Glenn-Ewing Glenn-Ewing merged commit 8968f8a into master Jan 14, 2026
10 checks passed
@Glenn-Ewing Glenn-Ewing deleted the add-psalm-scanning branch January 14, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants