-
Notifications
You must be signed in to change notification settings - Fork 56
62 lines (50 loc) · 1.52 KB
/
ci.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
53
54
55
56
57
58
59
60
61
62
name: CI
on:
push:
branches: ["**"]
pull_request_target:
types: [labeled]
jobs:
lint_and_typecheck:
if: ${{ github.event_name == 'push' || github.event.label.name == 'run-ci' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: check changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
sources:
- src/**
- tests/**
- scripts/**
- .github/workflows/ci.yml
- name: Install Rye
if: steps.changes.outputs.sources == 'true'
uses: eifinger/setup-rye@v3
with:
enable-cache: true
cache-prefix: "refiners-rye-cache"
- name: add Rye shims dir to PATH
if: steps.changes.outputs.sources == 'true'
run: echo "$RYE_HOME/shims" >> $GITHUB_PATH
- name: use uv
if: steps.changes.outputs.sources == 'true'
run: rye config --set-bool behavior.use-uv=true
- name: pin python
if: steps.changes.outputs.sources == 'true'
run: rye pin 3.10
- name: rye sync
if: steps.changes.outputs.sources == 'true'
run: rye sync --all-features
- name: rye fmt
if: steps.changes.outputs.sources == 'true'
run: rye fmt --check
- name: rye lint
if: steps.changes.outputs.sources == 'true'
run: rye lint
- name: typecheck
if: steps.changes.outputs.sources == 'true'
run: rye run pyright