diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml new file mode 100644 index 0000000..a7ac273 --- /dev/null +++ b/.github/workflows/rust-checks.yml @@ -0,0 +1,36 @@ +name: Rust Checks + +on: + pull_request: + paths-ignore: + - .gitignore + - LICENSE + - README.md + +jobs: + test: + name: cargo check/clippy/fmt/test + runs-on: ubuntu-latest + + env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + + steps: + - uses: actions/checkout@v3 + + - uses: Swatinem/rust-cache@v2 + with: + # Bump this to manually invalidate the build/dependency cache. + # It is also keyed on the job, rustc version, Cargo.lock, and other + # values explained here: https://github.com/Swatinem/rust-cache#cache-details + prefix-key: "v0-rust" + + - name: Check compilation + run: cargo check --verbose --locked + - name: Lint + run: cargo clippy + - name: Test + run: cargo test --verbose --locked + - name: Formatting + run: cargo fmt --verbose --check diff --git a/Cargo.toml b/Cargo.toml index 0a2f9cb..6003f4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "om-wikiparser" version = "0.0.0" -license = "AGPL-3.0-or-later" +license = "AGPL-3.0-only" edition = "2021" repository = "https://github.com/organicmaps/wikiparser/" diff --git a/src/main.rs b/src/main.rs index e58c983..f811ed2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,9 +2,7 @@ // pv ~/Downloads/enwiki-NS0-20230401-ENTERPRISE-HTML.json.tar.gz | tar xzO | cargo run --release > /dev/null use serde::Deserialize; -use std::{ - io::{self, stdin, BufRead, BufReader, Write}, -}; +use std::io::{self, stdin, BufRead, BufReader, Write}; #[derive(Deserialize)] struct Page {