Fix CI: install Perl deps and stub PVE::SafeSyslog for syntax check
perl -c requires all modules to be loadable at compile time. PVE::SafeSyslog only exists on Proxmox VE hosts, so the syntax check always failed on GitHub Actions runners. Fix: - Install real Perl deps via apt (libwww-perl, libio-socket-ssl-perl, librest-client-perl, libjson-perl) - Create a minimal stub for PVE::SafeSyslog so perl -c can load FreeNAS.pm - Pass -I/tmp/pve-stub to perl -c so the stub is found Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ce84a857c4
commit
84cc862bed
|
|
@ -26,13 +26,19 @@ jobs:
|
|||
- name: Install lint tools
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y shellcheck libperl-critic-perl
|
||||
sudo apt-get install -y \
|
||||
shellcheck libperl-critic-perl \
|
||||
libwww-perl libio-socket-ssl-perl librest-client-perl libjson-perl
|
||||
# PVE::SafeSyslog only exists on Proxmox hosts; stub it for syntax checking
|
||||
mkdir -p /tmp/pve-stub/PVE
|
||||
printf 'package PVE::SafeSyslog;\nuse Exporter "import";\nour @EXPORT = qw(syslog);\nsub syslog {}\n1;\n' \
|
||||
> /tmp/pve-stub/PVE/SafeSyslog.pm
|
||||
|
||||
- name: Perl syntax check (all modules)
|
||||
run: |
|
||||
echo "==> Checking Perl syntax..."
|
||||
find perl5 stable-*/perl5 -name "*.pm" -print0 \
|
||||
| xargs -0 -I{} perl -c {} \
|
||||
| xargs -0 -I{} perl -c -I/tmp/pve-stub {} \
|
||||
&& echo "All .pm files OK"
|
||||
|
||||
- name: Perl static analysis (perlcritic)
|
||||
|
|
|
|||
Loading…
Reference in New Issue