-
Notifications
You must be signed in to change notification settings - Fork 52
52 lines (50 loc) · 1.28 KB
/
lint_and_test.yml
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
51
52
name: Lint Python Code
on:
# Trigger the workflow on push to master or any pull request
push:
pull_request:
branches:
- main
jobs:
lock_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uv lock --locked
linting:
runs-on: ubuntu-latest
needs: [lock_file]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uvx ruff check .
formatting:
runs-on: ubuntu-latest
needs: [lock_file]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uvx ruff check --select I .
- run: uvx ruff format --check .
type_consistency:
runs-on: ubuntu-latest
needs: [lock_file]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uvx --with=types-PyYAML mypy
tests:
runs-on: ubuntu-latest
needs: [lock_file]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uv run --extra cpu pytest -s -v tests/unit_tests/
build:
runs-on: ubuntu-latest
needs: [lock_file, linting, formatting, type_consistency, tests]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: uv build