-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (45 loc) · 1.08 KB
/
pr.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
name: pr
on:
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: pr-${{ github.event.number }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
python: ${{ steps.filter.outputs.python }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
python:
- '**/*.py'
- 'pyproject.toml'
test-python:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.python == 'true'
steps:
- uses: actions/checkout@v4
- uses: eifinger/setup-rye@v3
id: setup-rye
with:
version: '0.34.0'
- run: rye pin 3.12.3
- name: Sync
run: |
rye sync
if [[ $(git diff --stat requirements.lock) != '' ]]; then
echo 'Rye lockfile not up-to-date'
git diff requirements.lock
exit 1
fi
- run: rye fmt --check
- run: rye lint
- run: rye run check
- run: rye run test