Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Dec 15, 2024
1 parent 8e96ef8 commit d8cfeed
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 86 deletions.
110 changes: 83 additions & 27 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,97 @@ name: Build and upload Rust crate
on: [push, pull_request]

jobs:
build_rust:
name: Build Rust stuff and run Rust tests
check_fmt:
name: Check format
runs-on: ubuntu-20.04

steps:
- name: Checkout reposistory
uses: actions/checkout@v4
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

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

- name: Setup clippy
run: rustup component add clippy
check_clippy:
name: Check clippy lints
runs-on: ubuntu-20.04

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Setup clippy
run: rustup component add clippy

- name: Run clippy
run: |
cargo clippy --version
cargo clippy --all-targets --all-features -- -D warnings
run_tests:
name: Run Rust tests
runs-on: ubuntu-20.04

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Run clippy
run: |
cargo clippy --version
cargo clippy --all-targets --all-features -- -D warnings
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Rust tests
run: cargo test --workspace

msrv:
runs-on: ubuntu-latest
steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup MSRV checker
uses: taiki-e/install-action@cargo-hack

# To find current MSRV use `cargo msrv find`. Install it with `cargo install cargo-msrv --locked`
- name: Run MSRV checker
run: cargo hack check --rust-version --workspace --all-targets --ignore-private

publish_crate:
name: Publish the crate!
runs-on: ubuntu-20.04
needs: [check_fmt, check_clippy, run_tests, msrv]

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Build Rust package
run: cargo build --release --workspace
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Rust tests
run: cargo test --workspace
- name: Build Rust package
run: cargo build --release --workspace

- name: Publish dry run
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
run: cargo publish --dry-run
- name: Publish dry run
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
run: cargo publish --dry-run

- name: Upload crate
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Upload crate
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and upload to PyPI

# Only run on releases
on:
push:
# Pattern matched against refs/tags
tags:
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
# on:
# push:
# # Pattern matched against refs/tags
# tags:
# - '**' # Push events to every tag including hierarchical tags like v1.0/beta

jobs:
build_wheels:
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ cython_debug/
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Set MSRV (minimal supported Rust version) to 1.66.1.

### Fixed

- Fix some instructions missing their corresponding AccessType.
- Fix some new clippy lints.

## [1.12.0] - 2024-07-21

Expand Down
159 changes: 159 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ description = "MIPS instruction decoder"
readme = "README.md"
repository = "https://github.com/Decompollaborate/rabbitizer"
license-file = "LICENSE"
rust-version = "1.66.1"
keywords = ["MIPS", "decoder"]
build = "rust/build.rs"
include = ["/rust/src", "/rust/build.rs", "/src", "/include", "/tables"]
Expand Down
Loading

0 comments on commit d8cfeed

Please sign in to comment.