diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d02eba7..9ab178d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: cargo directory: "/" schedule: - interval: daily + interval: monthly open-pull-requests-limit: 10 ignore: - dependency-name: "*" @@ -11,5 +11,5 @@ updates: - package-ecosystem: github-actions directory: "/" schedule: - interval: daily + interval: monthly open-pull-requests-limit: 10 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a44cb90..3070629 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,14 +7,34 @@ env: CARGO_TERM_COLOR: always jobs: - build: + build_library_msrv: + strategy: + matrix: + runs-on: + - ubuntu-latest + - macos-latest + - macos-latest + runs-on: ${{ matrix.runs-on }} + steps: + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.63.0 # MSRV + - name: Install required Linux packages for "audio-visualizer"/cpal/minifb + run: sudo apt update && sudo apt -y install libasound2-dev libxkbcommon-dev + + - run: cargo build + - run: rustup target add thumbv7em-none-eabihf + - run: cargo build --target thumbv7em-none-eabihf + + build_all_targets: runs-on: ubuntu-latest strategy: matrix: rust: - stable - nightly - - 1.63.0 # MSRV steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -41,7 +61,8 @@ jobs: strategy: matrix: rust: - - 1.63.0 # MSRV + - stable + - nightly steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain diff --git a/Cargo.toml b/Cargo.toml index 1b366b4..1942fd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,12 @@ description = """ An easy to use and fast `no_std` library (with `alloc`) to get the frequency spectrum of a digital signal (e.g. audio) using FFT. """ -version = "1.5.0" +version = "1.5.1" authors = ["Philipp Schuster "] edition = "2021" keywords = ["fft", "spectrum", "frequencies", "audio", "dsp"] -categories = ["multimedia", "no-std"] +categories = ["multimedia", "no-std", "no-std::no-alloc"] +rust-version = "1.63" # MSRV of base library, not examples and benchmarks readme = "README.md" license = "MIT" homepage = "https://github.com/phip1611/spectrum-analyzer" @@ -25,29 +26,25 @@ name = "fft_spectrum_bench" harness = false [dependencies] -microfft = { version = "0.5.1", features = ["size-16384"] } -# approx. compare floats; not only in tests but also during runtime -float-cmp = "0.9.0" -# sin() cos() log10() etc for no_std-environments; these are not part of Core library -libm = "0.2.7" -paste = "1.0.14" +float-cmp = "~0.10.0" +libm = "~0.2.7" +microfft = { version = "~0.5.1", features = ["size-16384"] } +paste = "~1.0.14" [dev-dependencies] -# readmp3 files in tests and examples -minimp3 = "0.5.1" -# visualize spectrum in tests and examples -audio-visualizer = "0.4.0" -# get audio input in examples -cpal = "0.15.2" -# audio data buffering -ringbuffer = "0.15.0" -rand = "0.8.5" # for benchmark -# exit in examples -ctrlc = "~3.3.1" # locked because of repo MSRV -# for benchmark -criterion = "~0.4.0" # locked because of repo MSRV +audio-visualizer = "~0.4.0" +minimp3 = "~0.5.1" +# Additional dependencies for: examples +cpal = "~0.15.2" +ctrlc = "~3.4.0" +ringbuffer = "~0.15.0" -# otherwise FFT and other code is too slow +# Additional dependencies for: benchmarks +criterion = "~0.5.0" +rand = "0.8.5" + + +# Faster code in tests, otherwise FFT is too slow [profile.dev] opt-level = 1 diff --git a/check-build.sh b/check-build.sh deleted file mode 100755 index 9435bbc..0000000 --- a/check-build.sh +++ /dev/null @@ -1,22 +0,0 @@ -set -e -set -x - -echo "checks that this builds on std+no_std + that all tests run + that all features compile" -cargo build --all-targets - -cargo test --all-targets - -cargo bench - -cargo fmt -- --check # (--check doesn't change the files) - -cargo doc --document-private-items - -cargo clippy --all-targets - -# test no_std -rustup target add thumbv7em-none-eabihf -cargo build --target thumbv7em-none-eabihf - -# run examples -cargo run --release --example mp3-samples