Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
workflow_dispatch:

jobs:
tests:
name: Python ${{ matrix.python-version }}, ${{ matrix.os }}
check_python:
name: Check Python ${{ matrix.python-version }}, ${{ matrix.os }}
Comment on lines +12 to +13
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone for the name "check" here rather than "test", since we're also running black, mypy, flake8 etc.

runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -22,14 +22,9 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- run: cargo test --no-default-features
working-directory: ./rust

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -43,6 +38,21 @@ jobs:
- name: Run tox targets for ${{ matrix.python-version }}
run: python -m tox

check_rust:
name: Check Rust
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run tests
run: cargo test --no-default-features
working-directory: ./rust
- name: Run linter (clippy)
run: cargo clippy --all-targets --all-features -- -D warnings
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are currently no violations - mainly because I've been using clippy when developing the rust graph on my branch.

working-directory: ./rust

benchmarks:
runs-on: ubuntu-22.04
steps:
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ To set up `grimp` for local development:

6. Submit a pull request through the GitHub website.

Rust code
---------

When working with the rust code (in the ``rust/`` directory):

* Run tests with ``cargo test --no-default-features``.
The ``--no-default-features`` flag is needed to due to `this PYO3 issue <https://pyo3.rs/main/faq#i-cant-run-cargo-test-or-i-cant-build-in-a-cargo-workspace-im-having-linker-issues-like-symbol-not-found-or-undefined-reference-to-_pyexc_systemerror>`_.
* Run `clippy <https://doc.rust-lang.org/clippy/index.html>`_ (a linter for rust) with ``cargo clippy --all-targets --all-features -- -D warnings``.
It's often possible to apply automatic fixes to clippy issues with the ``--fix`` flag e.g. ``cargo clippy --all-targets --all-features --fix --allow-staged``.

Pull Request Guidelines
-----------------------

Expand Down
Loading