-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.55 KB
/
lint.yml
File metadata and controls
50 lines (42 loc) · 1.55 KB
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
47
48
49
50
# This workflow will check our code for having a proper format, as well as the commit message to meet the expected ones
name: Lint
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
lint:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
- name: Install the project
run: uv sync --locked --group lint --group test --all-extras
- name: Cache mypy cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.1
with:
path: .mypy_cache
key: mypy-${{ runner.os }}
restore-keys: |
mypy-${{ runner.os }}
- name: Lint
run: |
uv run ruff format --check src tests eval
uv run ruff check src tests eval
uv run mypy src tests eval
lint-commit:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
name: "Lint commit message"
container:
image: commitizen/commitizen:4.8.3@sha256:08a078c52b368f85f34257a66e10645ee74d8cbe9b471930b80b2b4e95a9bd4a
steps:
- name: Check out
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check commit message
run: |
git config --global --add safe.directory /__w/lightman-ai/lightman-ai
cz check --rev-range HEAD