mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-05-01 00:31:09 +00:00
Add GitHub CI and fix clippy warnings
This commit is contained in:
parent
812d6c8602
commit
5fadffef4d
5 changed files with 106 additions and 1 deletions
89
.github/workflows/ci.yaml
vendored
Normal file
89
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: full
|
||||
RUSTDOCFLAGS: -Dwarnings
|
||||
RUSTFLAGS: -Dwarnings
|
||||
|
||||
jobs:
|
||||
style:
|
||||
name: Code style
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust stable
|
||||
run: |
|
||||
rustup update --no-self-update stable
|
||||
rustup default stable
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Rustfmt
|
||||
run: cargo fmt -- --check
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy --workspace --all-targets -- -D clippy::dbg_macro -D clippy::todo
|
||||
|
||||
- name: Rustdoc
|
||||
run: cargo doc --workspace
|
||||
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [stable]
|
||||
name: Test ${{ matrix.rust }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust ${{ matrix.rust }}
|
||||
run: |
|
||||
rustup update --no-self-update ${{ matrix.rust }}
|
||||
rustup default ${{ matrix.rust }}
|
||||
|
||||
- name: Cache Dependencies
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Build
|
||||
run: cargo build --workspace --all-targets
|
||||
|
||||
- name: Test
|
||||
run: cargo test --workspace --all-targets -- --include-ignored
|
||||
|
||||
nix-flake:
|
||||
name: Flake package
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install nix
|
||||
uses: cachix/install-nix-action@v26
|
||||
with:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Cache nix store
|
||||
uses: DeterminateSystems/magic-nix-cache-action@b46e247b898aa56e6d2d2e728dc6df6c84fdb738
|
||||
with:
|
||||
# I do NOT consent to share build cache between FlakeHub.
|
||||
# This should NOT be the default.
|
||||
use-flakehub: false
|
||||
|
||||
- name: Flake check
|
||||
run: nix flake check --no-update-lock-file --show-trace
|
||||
|
||||
- name: Flake build
|
||||
run: nix build --no-update-lock-file --show-trace --print-build-logs
|
|
@ -7,6 +7,12 @@ members = [
|
|||
]
|
||||
default-members = ["blahd"]
|
||||
|
||||
[workspace.lints.clippy]
|
||||
dbg_macro = "warn"
|
||||
print_stderr = "warn"
|
||||
print_stdout = "warn"
|
||||
todo = "warn"
|
||||
|
||||
[package]
|
||||
name = "blah"
|
||||
version = "0.0.0"
|
||||
|
@ -25,3 +31,6 @@ serde = { version = "1", features = ["derive"] }
|
|||
serde_jcs = "0.1"
|
||||
serde_json = "1"
|
||||
uuid = { version = "1", features = ["serde"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -14,3 +14,7 @@ rusqlite = "0.32"
|
|||
tokio = { version = "1", features = ["rt", "macros"] }
|
||||
|
||||
blah = { path = "..", features = ["rusqlite"] }
|
||||
|
||||
[lints.clippy]
|
||||
dbg_macro = "warn"
|
||||
todo = "warn"
|
||||
|
|
|
@ -27,3 +27,6 @@ uuid = { version = "1", features = ["v4"] }
|
|||
blah = { path = "..", features = ["rusqlite"] }
|
||||
basic-toml = "0.1.9"
|
||||
serde-inline-default = "0.2.0"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -356,7 +356,7 @@ async fn room_get_feed(
|
|||
))
|
||||
}
|
||||
|
||||
/// Ref: https://www.jsonfeed.org/version/1.1/
|
||||
/// Ref: <https://www.jsonfeed.org/version/1.1/>
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "version", rename = "https://jsonfeed.org/version/1.1")]
|
||||
struct FeedRoom {
|
||||
|
|
Loading…
Add table
Reference in a new issue