2023-07-14 14:47:44 +08:00
|
|
|
name: Linter
|
2022-10-15 16:19:16 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
2023-05-17 18:31:01 +08:00
|
|
|
lint-python:
|
2023-07-14 15:07:08 +08:00
|
|
|
name: ruff
|
2022-10-15 16:19:16 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-07-14 14:47:44 +08:00
|
|
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
2022-10-15 16:19:16 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
2023-05-10 04:02:44 +08:00
|
|
|
- uses: actions/setup-python@v4
|
2022-10-15 16:19:16 +08:00
|
|
|
with:
|
2023-05-10 04:02:44 +08: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
|
2023-06-13 18:07:06 +08:00
|
|
|
run: pip install ruff==0.0.272
|
2023-05-10 04:02:44 +08:00
|
|
|
- name: Run Ruff
|
|
|
|
run: ruff .
|
2023-05-17 18:31:01 +08:00
|
|
|
lint-js:
|
2023-07-14 15:07:08 +08:00
|
|
|
name: eslint
|
2023-05-17 18:31:01 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-07-14 14:47:44 +08:00
|
|
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
2023-05-17 18:31:01 +08:00
|
|
|
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
|