Skip to content

Commit

Permalink
Merge pull request #345 from product-os/clippy-cross
Browse files Browse the repository at this point in the history
Run clippy using cross for rust targets
  • Loading branch information
klutchell authored Nov 30, 2022
2 parents f920227 + f6bba58 commit 3f8619b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/flowzone.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ Multiple versions (>=3.7, <3.11) of Python will be tested as long as they meet t

If a `Cargo.toml` file is found in the root of the repository, Flowzone will run tests on the code formatting (using `cargo fmt` and `cargo clippy`) and then run tests for a set of target architectures given in [`cargo_targets`](#cargo_targets). In order to disable Rust testing, set the value of that variable to `""`.

For cross building targets, flowzone uses [cross](https://github.com/cross-rs/cross). This also means that further build options (e.g. [pre-build hooks](https://github.com/cross-rs/cross#pre-build-hook)) can be defined by adding a `Cross.toml` file to the local repository.

When [`rust_binaries`](#rust_binaries) is set to `true`, Flowzone will also build release artifacts for each target architecture given in [`cargo_targets`](#cargo_targets) and upload the artifacts to the GitHub release.

### GitHub
Expand Down
10 changes: 5 additions & 5 deletions flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ on:
type: string
required: false
default: aarch64-unknown-linux-gnu,
armv7-unknown-linux-gnueabi,
armv7-unknown-linux-gnueabihf,
arm-unknown-linux-gnueabihf,
x86_64-unknown-linux-gnu,
i686-unknown-linux-gnu
Expand Down Expand Up @@ -1697,17 +1697,17 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: rustfmt, clippy
components: rustfmt

- name: Check formatting
run: cargo fmt --check

- name: Lint with clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Install cross
run: cargo install cross

- name: Lint with clippy
run: cross clippy --all-targets --all-features -- -D warnings

- name: Run tests for toolchain ${{ matrix.target }}
run: cross test --target ${{ matrix.target }}

Expand Down

0 comments on commit 3f8619b

Please sign in to comment.