Skip to content

Commit ed8c643

Browse files
committed
ci: only trigger on source or config changes
1 parent 4c3a680 commit ed8c643

File tree

1 file changed

+34
-16
lines changed

1 file changed

+34
-16
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,27 @@ name: CI
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
6+
paths:
7+
- "src/**"
8+
- "tests/**"
9+
- "examples/**"
10+
- "pyproject.toml"
11+
- "uv.lock"
12+
- "justfile"
13+
- ".pre-commit-config.yaml"
14+
- ".github/workflows/ci.yml"
615
pull_request:
7-
branches: [ "main" ]
16+
branches: ["main"]
17+
paths:
18+
- "src/**"
19+
- "tests/**"
20+
- "examples/**"
21+
- "pyproject.toml"
22+
- "uv.lock"
23+
- "justfile"
24+
- ".pre-commit-config.yaml"
25+
- ".github/workflows/ci.yml"
826

927
jobs:
1028
test:
@@ -19,21 +37,21 @@ jobs:
1937
os: macos-latest
2038

2139
steps:
22-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v4
2341

24-
- name: Install uv and set Python version
25-
uses: astral-sh/setup-uv@v7
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
enable-cache: true
42+
- name: Install uv and set Python version
43+
uses: astral-sh/setup-uv@v7
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
enable-cache: true
2947

30-
- name: Install dependencies
31-
run: uv sync --locked --all-extras --dev
48+
- name: Install dependencies
49+
run: uv sync --locked --all-extras --dev
3250

33-
- name: Run linter and static analysis
34-
run: |
35-
uv run ruff check
36-
uv run ruff format --check
51+
- name: Run linter and static analysis
52+
run: |
53+
uv run ruff check
54+
uv run ruff format --check
3755
38-
- name: Run tests
39-
run: uv run pytest
56+
- name: Run tests
57+
run: uv run pytest

0 commit comments

Comments
 (0)