Add Perl static analysis

* Run perl -c on every t/*.t file as a fast pre-check before prove.
* Add Perl::Critic (a curated policy set) and perltidy --check for the Perl test code — the repo lints its bash with shellcheck but has zero linting for its Perl.
* Add Test::NoWarnings (and/or Test::Fatal) to the test harness so warnings/exceptions in the code under test fail the build.

Not yet sure about using the hash / SHA-pinning. To be reconsidered later
This commit is contained in:
Dirk Wetter
2026-08-31 20:05:30 +02:00
parent 853850e3f4
commit f5d228e28e
+38
View File
@@ -0,0 +1,38 @@
name: Perl quality
on:
pull_request:
paths:
- 't/**'
- 'cpanfile'
- '.perlcritic'
- '.github/workflows/perl-quality.yml'
permissions:
contents: read
jobs:
perl:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: shivammathur/setup-perl@v14
with:
perl-version: '5.38'
- name: Install dev modules
run: cpanm --notest Perl::Critic perltidy cpan-audit
- name: Syntax check all test files
run: |
find t -name '*.t' -o -name '*.pm' | while read -r f; do
perl -I t/lib -c "$f"
done
- name: Perl::Critic
run: perlcritic --verbose '%f:%l:%e:%m\n' t/
- name: perltidy (fail on diff)
run: |
perltidy -p t/
git diff --exit-code
- name: Audit CPAN modules for known CVEs
run: cpan-audit