Issue #2689: Pass action to TicketAcl sub to enable restricting activ… #778
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.1 | |
--- | |
name: 'CacheLocalLib' | |
on: | |
push: | |
branches: | |
- rel-10_0 | |
- rel-10_1 | |
jobs: | |
CacheLocalLib: | |
runs-on: 'ubuntu-latest' | |
env: | |
PERL5LIB: local/lib/perl5 | |
steps: | |
# Use caching for not needing to reinstall modules from CPAN for every check. | |
# Packages are reinstalled when cpanfile.docker changes or when | |
# cache key is manually changed. | |
# Set current date for forcing a rebuild. In this case, make sure that | |
# code_policy.yml, syntax_check.yml, and cache_local_lib.yml are kept in sync. | |
# The rules where the cache is visible are not obvious. Essentially the cache must be created on an ancestor branch. | |
# For that there is cache_local_lib.yml. | |
# See https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache | |
- name: Get SHA via the Github REST interface | |
uses: actions/github-script@v4 | |
id: get-sha | |
with: | |
script: | | |
var cpanfile_docker_content = await github.repos.getContent({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
path: 'cpanfile.docker', | |
ref: context.ref, | |
}); | |
return cpanfile_docker_content.data.sha; | |
result-encoding: string | |
- name: 'Print SHA of cpanfile.docker' | |
run: echo '${{steps.get-sha.outputs.result}}' | |
- name: 'check cache for CPAN modules' | |
uses: actions/cache@v2 | |
id: cache_local_lib | |
with: | |
path: local | |
key: ${{ runner.os }}-${{steps.get-sha.outputs.result}}-local_lib-20210928n | |
- name: 'checkout otobo' | |
if: steps.cache_local_lib.outputs.cache-hit != 'true' | |
uses: actions/checkout@v2 | |
- name: 'Get SHA of cpanfile.docker for doublechecking' | |
id: get-sha-doublecheck | |
if: steps.cache_local_lib.outputs.cache-hit != 'true' | |
run: | | |
echo "::set-output name=sha::$(git rev-parse :cpanfile.docker)" | |
echo "::set-output name=ls::$(ls -l cpanfile.docker)" | |
- name: 'Print SHA of cpanfile.docker for doublechecking' | |
if: steps.cache_local_lib.outputs.cache-hit != 'true' | |
run: | | |
echo '${{steps.get-sha-doublecheck.outputs.sha}}' | |
echo '${{steps.get-sha-doublecheck.outputs.ls}}' | |
- name: 'install dependencies' | |
if: steps.cache_local_lib.outputs.cache-hit != 'true' | |
run: sudo apt install -y libxml2-utils libxslt-dev | |
- name: 'install Perl modules from CPAN' | |
if: steps.cache_local_lib.outputs.cache-hit != 'true' | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
install: | | |
Code::TidyAll | |
Perl::Critic | |
cpanfile: cpanfile.docker | |
global: false | |
tests: false | |
sudo: false |