Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance CI workflow with additional checks and build steps #10

Closed
wants to merge 4 commits into from
Closed
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
36 changes: 31 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3

- name: Install Rust nightly
run: |
curl -sSf https://rust-lang.org/install.sh | sh
rustup default nightly

- name: Install cargo-audit
run: cargo install cargo-audit

- name: Check for vulnerabilities
run: cargo audit

- name: Format code
run: |
rustup component add rustfmt
cargo fmt --all -- --check

- name: Run Clippy linter
run: |
rustup component add clippy
cargo clippy -- -D warnings
Copy link
Contributor

Choose a reason for hiding this comment

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

The issue here is that it is going to force some areas in the code to fail this warning, but functionally they are designed that way for a reason

Copy link
Author

Choose a reason for hiding this comment

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

please give me some time alex i will work on this

Copy link
Author

Choose a reason for hiding this comment

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

@AlexsJones i used this command cargo clippy -- -D warnings to deny all the lint errors that will stop the workflow hoping it would make the codebase clean . But i get your point, some things are designed that way for a specific reason right .

So instead of denying all the lint errors we can modify it in such a way that it will only denies specific lint using the command cargo clippy -- -A clippy::all -D clippy::absurd_extreme_comparisons. But i think whitelisting each lints by name is a time consuming task and it wont be effective . So for this, we can make use of the lint groups that are available in clippy but even still this might be a roadblock for devs because it will throw errors .

Kindly share your thoughts on this whether we can remove this clippy feature or we can whilelist particular lints (by name or by group) and i will make the necessary changes alex.

PS : for your reference list of lints available in clippy


- name: Run cargo check
run: cargo check --all-features --workspace --verbose

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose --all-features --all-targets
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
### Cutting a release

- Increment the `Cargo.toml`
- Release via pushing a tag
- Release via pushing a tag

### Format the code for better codebase

- Contributors please make sure to run `cargo fmt` in your local before submitting a PR
- Reference for installing `cargo fmt` in local [rust-](https://github.com/rust-lang/rustfmt)
Loading