Skip to content

Commit

Permalink
Use App::cpm to install perlcritic faster, and clean .perl-cpm cache (
Browse files Browse the repository at this point in the history
#3036)

* Use App:cpm to install perlcritic faster, and clean cache

* [build-command] Update generated files

* Update CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
echoix and github-actions[bot] authored Oct 23, 2023
1 parent 8fa7597 commit ee201af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Free disk space earlier in the process to avoid failure during docker build
- Set flavors-stats.json as a generated file in .gitattributes ([#3023](https://github.com/oxsecurity/megalinter/pull/3023))
- Update and fix our ChatOps automations to only run on pull request comments, by @echoix in [#3034](https://github.com/oxsecurity/megalinter/pull/3034)
- Use App::cpm to install perlcritic faster, and clean `.perl-cpm` cache, by @echoix in [#3036](https://github.com/oxsecurity/megalinter/pull/3036)
- Add failure message in ChatOps build-command and Slash dispatcher, by @echoix in [#3037](https://github.com/oxsecurity/megalinter/pull/3037)

- Linter versions upgrades
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,9 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P
# Managed with COPY --link --from=checkmake /checkmake /usr/bin/checkmake

# perlcritic installation
&& curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
&& curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \
&& rm -rf /root/.perl-cpm


# phpcs installation
RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192
Expand Down
4 changes: 3 additions & 1 deletion linters/perl_perlcritic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \
#############################################################################################
#OTHER__START
# perlcritic installation
RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
RUN curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \
&& rm -rf /root/.perl-cpm


#OTHER__END

Expand Down
4 changes: 3 additions & 1 deletion megalinter/descriptors/perl.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ linters:
- "perlcritic myfile.pl"
install:
dockerfile:
- RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
- |
RUN curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \
&& rm -rf /root/.perl-cpm

0 comments on commit ee201af

Please sign in to comment.