Skip to content

split ci into pr/release #3

split ci into pr/release

split ci into pr/release #3

Workflow file for this run

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)