diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..49648e7 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,65 @@ +name: Run clippy + +on: + push: + branches: ["*"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + clippy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/.rustup/toolchains/ + target/ + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} + + # - name: Install WASM toolchain + # run: rustup target add wasm32-unknown-unknown + + - name: Check project + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + # - name: Check project (WASM) + # # Note lack of --all-targets here because tests and examples are not wasm compatible + # run: cargo clippy --workspace --all-features --target wasm32-unknown-unknown -- -D warnings + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/.rustup/toolchains/ + target/ + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + + - name: Check project + run: RUST_BACKTRACE=1 cargo test --workspace --all-targets --all-features diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e88baf1..86fa974 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,16 @@ [toolchain] channel = "1.88.0" +components = [ + "rustc", + "cargo", + "rustfmt", + "rust-std", + "rust-docs", + "rust-analyzer", + "clippy", + # "miri", + "rust-src", + # "rust-mingw", + # "llvm-tools", + # "rustc-dev", +] diff --git a/src/api/tests/mod.rs b/src/api/tests/mod.rs index a6166f2..b2b37ee 100644 --- a/src/api/tests/mod.rs +++ b/src/api/tests/mod.rs @@ -31,6 +31,7 @@ struct Error { } #[tokio::test] +#[ignore] async fn deserialisation() -> Result<()> { let _posts: Vec> = serde_json::from_str(&read_to_string(ALL_POSTS)?)?; let _posts: Vec = serde_json::from_str(&read_to_string(OK_POSTS)?)?;