-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 1.66 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 }}
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
python:
- 'py/**'
- 'pyproject.toml'
rust:
- 'upid_rs/**'
- 'upid_pg/**'
- 'Cargo.toml'
- 'Cargo.lock'
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
test-rust:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.rust == 'true'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --check
- run: cargo clippy
working-directory: upid_rs
- run: cargo test --all-features
working-directory: upid_rs
# TODO Need to also run upid_pg tests (bit more complicated)