|
| 1 | +name: Static analysis |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - devel |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - devel |
| 12 | + |
| 13 | +defaults: |
| 14 | + run: |
| 15 | + shell: bash |
| 16 | + |
| 17 | +jobs: |
| 18 | + cloc: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout the code |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Download and run cloc |
| 25 | + run: | |
| 26 | + curl -s https://raw.githubusercontent.com/AlDanial/cloc/master/cloc > cloc |
| 27 | + chmod +x cloc |
| 28 | + ./cloc --version |
| 29 | + ./cloc $(git ls-files) |
| 30 | +
|
| 31 | + black: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - name: Checkout the code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Code formatting with black |
| 38 | + run: | |
| 39 | + pip install black "black[jupyter]" |
| 40 | + black --check src/ |
| 41 | + black --check tutorials/ |
| 42 | +
|
| 43 | + isort: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Checkout the code |
| 47 | + uses: actions/checkout@v4 |
| 48 | + |
| 49 | + - name: Code formatting with isort |
| 50 | + run: | |
| 51 | + pip install isort |
| 52 | + isort --check src/ |
| 53 | + isort --check tutorials/ |
| 54 | +
|
| 55 | + mypy: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + continue-on-error: true |
| 58 | + steps: |
| 59 | + - name: Checkout the code |
| 60 | + uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - name: Type checking with mypy |
| 63 | + run: | |
| 64 | + pip install mypy |
| 65 | + mypy src/ || true |
| 66 | +
|
| 67 | + prospector: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + continue-on-error: true |
| 70 | + steps: |
| 71 | + - name: Checkout the code |
| 72 | + uses: actions/checkout@v4 |
| 73 | + |
| 74 | + - name: Code analysis with prospector |
| 75 | + run: | |
| 76 | + pip install prospector |
| 77 | + prospector src/ || true |
| 78 | +
|
| 79 | + ruff: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + continue-on-error: true |
| 82 | + steps: |
| 83 | + - name: Checkout the code |
| 84 | + uses: actions/checkout@v4 |
| 85 | + |
| 86 | + - name: Linting with ruff |
| 87 | + run: | |
| 88 | + pip install ruff |
| 89 | + ruff check src/ || true |
| 90 | +
|
| 91 | + pylint: |
| 92 | + runs-on: ubuntu-latest |
| 93 | + continue-on-error: true |
| 94 | + steps: |
| 95 | + - name: Checkout the code |
| 96 | + uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Linting with pylint |
| 99 | + run: | |
| 100 | + pip install pylint |
| 101 | + pylint src/ || true |
0 commit comments