Skip to content

ra/SAPCMControlZone: solving shellcheck issues #8

ra/SAPCMControlZone: solving shellcheck issues

ra/SAPCMControlZone: solving shellcheck issues #8

name: checkers_and_linters
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for some branches
push:
branches: [ main, first-steps ]
pull_request:
branches: [ main ]
jobs:
# This workflow contains a single job called "checksAndlinters"
ChecksAndLinters:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install needed packages
run: |
echo "Perl Linter"
echo "Install perlcritic..."
id -a
sudo apt-get -y install libtest-perl-critic-perl
which perlcritic
echo "Flake8"
echo "Install cke8..."
id -a
sudo apt-get -y install flake8
which flake8
echo "Pylint"
echo "Install pylint..."
python -m pip install --upgrade pip
pip install --force-reinstall pylint==2.17.4
which pylint
continue-on-error: true
# Runs a set of commands using the runners shell
- name: Checks scripts with shellcheck
shell: bash
run: |
echo "Running Shellcheck..."
find ra test -type f -name '*' -exec awk ' /^#!.*bash/{print FILENAME} {nextfile}' {} + | xargs shellcheck -a -x -s bash && echo "Everything is OK!"
continue-on-error: false
# Runs a perl linter
- name: Running perl linter
shell: bash
run: |
echo "Running perlcritic..."
find . -type f -name '*' ! -path './test/*' -exec awk ' /^#!.*perl/{print FILENAME} {nextfile}' {} + | xargs perlcritic --gentle && echo "Everything is OK!"
continue-on-error: true
# Runs flake8
- name: Running flake8
shell: bash
run: |
echo "Running flake8..."
find . -type f -name '*.py' ! -path './test/*' | xargs flake8 --ignore=E501,E722,E126 && echo "Everything is OK!"
continue-on-error: true
# Runs pylint
- name: Running pylint
shell: bash
run: |
echo "Running pylint..."
find . -type f -name '*.py' ! -path './test/*' | xargs pylint --disable=duplicate-code && echo "Everything is OK!"
continue-on-error: true