add examples #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
working-directory: py | |
- run: rye lint | |
working-directory: py | |
- run: rye run check | |
working-directory: py | |
- run: rye run test | |
working-directory: py | |
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 | |
working-directory: upid_rs | |
- 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) |