Skip to content

Commit

Permalink
Add CI for CLI tool crate.
Browse files Browse the repository at this point in the history
This commit also fixes a small issue found by clippy.
  • Loading branch information
yotarok committed Sep 20, 2023
1 parent d134704 commit a978830
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,29 @@ jobs:
override: true
components: rustfmt, clippy
- name: Install external dependencies
run: sudo apt-get install -y libsndfile1-dev
run: sudo apt-get update && sudo apt-get install -y libsndfile1-dev
- name: Run cargo check
uses: actions-rs/cargo@v1
uses: ClementTsang/cargo[email protected]
with:
command: check
args: --verbose --all-targets --all-features
- name: Run tests
uses: actions-rs/cargo@v1
uses: ClementTsang/cargo[email protected]
with:
command: test
args: --verbose

args: --verbose --all-targets --all-features
- name: Run cargo check (CLI)
uses: ClementTsang/[email protected]
with:
command: check
args: --verbose --all-targets --all-features
directory: flacenc-bin
- name: Run tests (CLI)
uses: ClementTsang/[email protected]
with:
command: test
args: --verbose --all-targets --all-features
directory: flacenc-bin
lints:
runs-on: ubuntu-latest
steps:
Expand All @@ -47,14 +59,26 @@ jobs:
override: true
components: rustfmt, clippy
- name: Code format check
uses: actions-rs/cargo@v1
uses: ClementTsang/cargo[email protected]
with:
command: fmt
args: --check
- name: Clippy
uses: actions-rs/cargo@v1
uses: ClementTsang/cargo[email protected]
with:
command: clippy
args: --tests -- -D warnings
- name: Generate docs (for doc syntax checking)
run: cargo doc
- name: Code format check (CLI tools)
uses: ClementTsang/[email protected]
with:
command: fmt
args: --check
directory: flacenc-bin
- name: Clippy (CLI tools)
uses: ClementTsang/[email protected]
with:
command: clippy
args: --tests -- -D warnings
directory: flacenc-bin
2 changes: 1 addition & 1 deletion flacenc-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn run_encoder(
source: source::PreloadedSignal,
) -> Result<Stream, SourceError> {
let block_size = encoder_config.block_sizes[0];
coding::encode_with_fixed_block_size(&encoder_config, source, block_size)
coding::encode_with_fixed_block_size(encoder_config, source, block_size)
}

#[allow(clippy::expect_used)]
Expand Down

0 comments on commit a978830

Please sign in to comment.