my-sd/.gitea/workflows/on_pull_request.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.3 KiB
YAML
Raw Normal View History

name: Linter
on:
- push
- pull_request
jobs:
2023-05-17 10:31:01 +00:00
lint-python:
2023-07-14 07:07:08 +00:00
name: ruff
2024-05-03 17:35:23 +00:00
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout Code
uses: actions/checkout@v3
2024-05-03 18:24:59 +00:00
- uses: actions/setup-python@v5
2024-05-03 18:33:08 +00:00
# with:
# python-version: 3.11.0
2023-05-09 20:02:44 +00:00
# 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.
2024-05-03 18:42:23 +00:00
- name: deps
2024-05-03 18:43:07 +00:00
run: apt update && apt install python3-pip -y
2023-05-09 20:02:44 +00:00
- name: Install Ruff
2024-05-03 18:44:00 +00:00
run: pip install ruff==0.1.6 #--break-system-packages
2023-05-09 20:02:44 +00:00
- name: Run Ruff
2024-05-03 17:35:23 +00:00
run: ruff .
2024-05-03 18:42:23 +00:00
# lint-js:
# name: eslint
# runs-on: ubuntu-latest
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
# 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
2024-05-04 16:18:14 +00:00