|
| 1 | +--- |
| 2 | +name: Lint Code Base |
| 3 | + |
| 4 | +defaults: |
| 5 | + run: |
| 6 | + # To load bashrc |
| 7 | + shell: bash -ieo pipefail {0} |
| 8 | + |
| 9 | +on: |
| 10 | + pull_request: |
| 11 | + branches: [master, dev] |
| 12 | + schedule: |
| 13 | + # run CI every day even if no PRs/merges occur |
| 14 | + - cron: '0 12 * * *' |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + packages: read |
| 19 | + # To report GitHub Actions status checks |
| 20 | + statuses: write |
| 21 | + |
| 22 | +jobs: |
| 23 | + pylint: |
| 24 | + name: Lint Code Base (pylint) |
| 25 | + runs-on: ubuntu-latest |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout Code |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + # super-linter needs the full git history to get the |
| 32 | + # list of files that changed across commits |
| 33 | + fetch-depth: 0 |
| 34 | + |
| 35 | + - name: Set up Python 3.8 |
| 36 | + uses: actions/setup-python@v5 |
| 37 | + with: |
| 38 | + python-version: 3.8 |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: | |
| 42 | + mkdir -p .github/linters |
| 43 | + cp pyproject.toml .github/linters |
| 44 | +
|
| 45 | + - name: Pylint |
| 46 | + uses: super-linter/super-linter/[email protected] |
| 47 | + if: always() |
| 48 | + env: |
| 49 | + # run linter on everything to catch preexisting problems |
| 50 | + VALIDATE_ALL_CODEBASE: true |
| 51 | + DEFAULT_BRANCH: master |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + # Run only pylint |
| 54 | + VALIDATE_PYTHON: true |
| 55 | + VALIDATE_PYTHON_PYLINT: true |
| 56 | + PYTHON_PYLINT_CONFIG_FILE: pyproject.toml |
| 57 | + FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol) |
| 58 | + |
| 59 | + black: |
| 60 | + name: Lint Code Base (black) |
| 61 | + runs-on: ubuntu-latest |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: Checkout Code |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + # super-linter needs the full git history to get the |
| 68 | + # list of files that changed across commits |
| 69 | + fetch-depth: 0 |
| 70 | + |
| 71 | + - name: Set up Python 3.8 |
| 72 | + uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: 3.8 |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: | |
| 78 | + mkdir -p .github/linters |
| 79 | + cp pyproject.toml .github/linters |
| 80 | +
|
| 81 | + - name: Black |
| 82 | + uses: super-linter/super-linter/[email protected] |
| 83 | + if: always() |
| 84 | + env: |
| 85 | + # run linter on everything to catch preexisting problems |
| 86 | + VALIDATE_ALL_CODEBASE: true |
| 87 | + DEFAULT_BRANCH: master |
| 88 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 89 | + # Run only black |
| 90 | + VALIDATE_PYTHON_BLACK: true |
| 91 | + PYTHON_BLACK_CONFIG_FILE: pyproject.toml |
| 92 | + FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol) |
0 commit comments