aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/on_pull_request.yaml
blob: d42965b15c9422968924955180755d7a74bfc284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# See https://github.com/actions/starter-workflows/blob/1067f16ad8a1eac328834e4b0ae24f7d206f810d/ci/pylint.yml for original reference file
name: Run Linting/Formatting on Pull Requests

on:
  - push
  - pull_request
  # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore for syntax docs
  # if you want to filter out branches, delete the `- pull_request` and uncomment these lines :
  # pull_request:  
  #  branches:
  #    - master
  #  branches-ignore:
  #    - development

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.11
          # NB: there's no cache: pip here since we're not installing anything
          #     from the requirements.txt file(s) in the repository; it's faster
          #     not to have GHA download an (at the time of writing) 4 GB cache
          #     of PyTorch and other dependencies.
      - name: Install Ruff
        run: pip install ruff==0.0.265
      - name: Run Ruff
        run: ruff .

# The rest are currently disabled pending fixing of e.g. installing the torch dependency.

#      - name: Install PyLint
#        run: |
#          python -m pip install --upgrade pip
#          pip install pylint
#      # This lets PyLint check to see if it can resolve imports
#      - name: Install dependencies
#        run: |
#          export COMMANDLINE_ARGS="--skip-torch-cuda-test --exit"
#          python launch.py
#      - name: Analysing the code with pylint
#        run: |
#          pylint $(git ls-files '*.py')