2022-10-15 08:19:16 +00:00
|
|
|
name: Run Linting/Formatting on Pull Requests
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
2023-05-17 10:31:01 +00:00
|
|
|
lint-python:
|
2022-10-15 08:19:16 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
2023-05-09 20:02:44 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2022-10-15 08:19:16 +00:00
|
|
|
with:
|
2023-05-09 20:02:44 +00:00
|
|
|
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 .
|
2023-05-17 10:31:01 +00:00
|
|
|
lint-js:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- run: npm i --ci
|
|
|
|
- run: npm run lint
|