2020-07-30 10:37:14 +02:00
|
|
|
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
|
|
|
name: scriptcheck
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2020-12-15 10:59:09 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-20 13:26:28 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
|
2020-07-30 10:37:14 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-02-20 13:26:28 +01:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install missing software on ubuntu (Python 2)
|
|
|
|
if: matrix.python-version == '2.7'
|
|
|
|
run: |
|
|
|
|
python -m pip install pip --upgrade
|
|
|
|
python -m pip install pytest
|
|
|
|
|
|
|
|
- name: Install missing software on ubuntu (Python 3)
|
|
|
|
if: matrix.python-version != '2.7'
|
2020-07-30 10:37:14 +02:00
|
|
|
run: |
|
2021-02-21 14:17:02 +01:00
|
|
|
sudo apt-get install shellcheck libxml2-utils
|
2021-02-20 13:26:28 +01:00
|
|
|
python -m pip install pip --upgrade
|
|
|
|
python -m pip install natsort
|
|
|
|
python -m pip install pexpect
|
|
|
|
python -m pip install pylint
|
|
|
|
python -m pip install unittest2
|
|
|
|
python -m pip install pytest
|
|
|
|
python -m pip install pygments
|
|
|
|
python -m pip install requests
|
|
|
|
|
2020-07-30 10:37:14 +02:00
|
|
|
- name: run Shellcheck
|
2021-02-20 13:26:28 +01:00
|
|
|
if: matrix.python-version == '3.8'
|
2020-07-30 10:37:14 +02:00
|
|
|
run: |
|
2021-01-20 18:43:49 +01:00
|
|
|
find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231
|
2020-07-30 10:37:14 +02:00
|
|
|
|
|
|
|
- name: run pylint
|
2021-02-20 13:26:28 +01:00
|
|
|
if: matrix.python-version == '3.8'
|
2020-07-30 10:37:14 +02:00
|
|
|
run: |
|
2021-02-20 13:26:28 +01:00
|
|
|
pylint --rcfile=pylintrc_travis addons/*.py
|
2020-07-30 10:37:14 +02:00
|
|
|
pylint --rcfile=pylintrc_travis htmlreport/cppcheck-htmlreport
|
|
|
|
pylint --rcfile=pylintrc_travis htmlreport/*.py
|
|
|
|
pylint --rcfile=pylintrc_travis tools/*.py
|
2020-09-05 18:29:19 +02:00
|
|
|
|
|
|
|
- name: check .json files
|
2021-02-20 13:26:28 +01:00
|
|
|
if: matrix.python-version == '3.8'
|
2020-09-05 18:29:19 +02:00
|
|
|
run: |
|
2021-02-20 13:26:28 +01:00
|
|
|
find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null
|
|
|
|
|
2021-02-21 14:17:02 +01:00
|
|
|
- name: Validate
|
|
|
|
if: matrix.python-version == '3.8'
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) validateCFG validatePlatforms validateRules
|
|
|
|
|
2021-02-20 13:26:28 +01:00
|
|
|
- name: check python syntax
|
|
|
|
if: matrix.python-version != '2.7'
|
|
|
|
run: |
|
|
|
|
python -m py_compile ./tools/donate-cpu.py
|
|
|
|
python -m py_compile ./tools/donate-cpu-server.py
|
|
|
|
|
|
|
|
- name: compile addons
|
|
|
|
run: |
|
|
|
|
python -m compileall ./addons
|
2020-11-24 07:48:13 +01:00
|
|
|
|
|
|
|
- name: test addons
|
|
|
|
run: |
|
2021-02-20 13:26:28 +01:00
|
|
|
make -j$(nproc) -s
|
2020-11-24 07:48:13 +01:00
|
|
|
PYTHONPATH=./addons python -m pytest addons/test/test-*.py
|
2021-02-21 14:17:02 +01:00
|
|
|
|
|
|
|
- name: dmake
|
|
|
|
if: matrix.python-version == '3.8'
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) run-dmake
|
|
|
|
git diff --exit-code
|