Debugging linter rules #494
Workflow file for this run
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
name: tests | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push events | |
push: | |
branches: [ 'main' ] | |
tags-ignore: [ '**' ] | |
# Triggers the workflow on pull request events | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
code_checks: | |
name: code checks | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false # false: try to complete all jobs | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[tests,examples] ./transformations ./lint_rules | |
pip list | |
- name: Add pylint annotator | |
uses: pr-annotators/[email protected] | |
- name: Analysing the code with pylint | |
run: | | |
pylint --rcfile=.pylintrc loki tests | |
pushd transformations && pylint --rcfile=../.pylintrc transformations tests; popd | |
pushd lint_rules && pylint --rcfile=../.pylintrc lint_rules tests; popd | |
jupyter nbconvert --to=script --output-dir=example_converted example/*.ipynb | |
pylint --rcfile=.pylintrc_ipynb example_converted/*.py | |
pytest: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false # false: try to complete all jobs | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Refresh package lists | |
run: | | |
sudo apt-get -o Acquire::Retries=3 update || true | |
- name: Install Loki dependencies | |
run: | | |
sudo apt-get -o Acquire::Retries=3 install -y graphviz gfortran | |
- name: Install OMNI + CLAW dependencies | |
run: | | |
sudo apt-get -o Acquire::Retries=3 install -y byacc flex openjdk-11-jdk cmake ant | |
- name: Install Loki | |
run: | | |
./install --with-claw --with-ofp --with-examples --with-tests --with-dace | |
- name: Install up-to-date CMake | |
run: | | |
source loki-activate | |
pip install cmake | |
- name: Run Loki tests | |
run: | | |
source loki-activate | |
pytest --cov=./loki --cov-report=xml tests | |
- name: Upload loki coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: loki | |
files: ./coverage.xml | |
- name: Run transformations tests | |
run: | | |
source loki-activate | |
pytest --cov=transformations/transformations --cov-report=xml transformations/tests | |
- name: Upload transformations coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: transformations | |
files: ./coverage.xml | |
- name: Run lint_rules tests | |
run: | | |
source loki-activate | |
pytest --cov=lint_rules/lint_rules --cov-report=xml lint_rules/tests | |
- name: Upload lint_rules coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: lint_rules | |
files: ./coverage.xml |