From 59912706508230aedf0a175361eac44ed1d7fc65 Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Tue, 30 May 2023 13:07:46 -0400 Subject: [PATCH 1/9] Fix license identifier Signed-off-by: Evan Lloyd New-Schmidt --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/" -- 2.45.3 From c38870a3a089727965d3d0d3f1bdf0af57d1d52c Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Tue, 30 May 2023 16:34:44 -0400 Subject: [PATCH 2/9] Add CI tests A cached setup that includes cargo check, clippy, fmt, and test Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2ec9feb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: Continuous Integration + +on: [push, pull_request] + +jobs: + test: + strategy: + fail-fast: false + name: cargo check/clippy/fmt/test + runs-on: ubuntu-latest + + env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + + steps: + - uses: actions/checkout@v3 + + - run: rustup toolchain install stable --profile minimal + + - uses: Swatinem/rust-cache@v2 + with: + # bump this to invalidate build/dependency cache + 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 -- 2.45.3 From c594288544cbd8b37ca94117176a0295d2689b3e Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Tue, 30 May 2023 17:21:26 -0400 Subject: [PATCH 3/9] Fix formatting Signed-off-by: Evan Lloyd New-Schmidt --- src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 { -- 2.45.3 From 74d4c5e12a77459e4d21487be730f268054c2917 Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 09:30:28 -0400 Subject: [PATCH 4/9] Remove explicit rustup install cargo, etc. is already installed, see: Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ec9feb..595a5e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,6 @@ jobs: steps: - uses: actions/checkout@v3 - - run: rustup toolchain install stable --profile minimal - - uses: Swatinem/rust-cache@v2 with: # bump this to invalidate build/dependency cache -- 2.45.3 From ddcfc1f3d9024efa63ce44c88c2de0a6713c993b Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 09:31:22 -0400 Subject: [PATCH 5/9] Add more context to cache prefix-key Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 595a5e8..6e679a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,9 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - # bump this to invalidate build/dependency cache + # 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: prefix-key: "v0-rust" - name: Check compilation -- 2.45.3 From ebf28240e86101833a7583bc7991d0b9fd82586d Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 15:48:30 -0400 Subject: [PATCH 6/9] Apply suggestions from code review Co-authored-by: Alexander Borsuk <170263+biodranik@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e679a2..0005282 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: Continuous Integration -on: [push, pull_request] +on: pull_request jobs: test: @@ -18,9 +18,9 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - # Bump this to manually invalidate the build/dependency cache + # 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: + # values explained here: https://github.com/Swatinem/rust-cache#cache-details prefix-key: "v0-rust" - name: Check compilation -- 2.45.3 From 454a3cad4304ed5ad31515bd1c463fd4bda8b01c Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 17:51:44 -0400 Subject: [PATCH 7/9] Ignore non-rust files Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0005282..17e71c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,11 @@ -name: Continuous Integration +name: Rust Checks -on: pull_request +on: + pull_request: + paths-ignore: + - .gitignore + - LICENSE + - README.md jobs: test: -- 2.45.3 From 17e8f22c9400e46c0bef4b99aee948a858e734eb Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 17:53:29 -0400 Subject: [PATCH 8/9] Remove unused matrix testing key Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17e71c4..a7ac273 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,6 @@ on: jobs: test: - strategy: - fail-fast: false name: cargo check/clippy/fmt/test runs-on: ubuntu-latest -- 2.45.3 From 97de15d13632bf712150c1b1ca7e7add55aca098 Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Wed, 31 May 2023 17:55:35 -0400 Subject: [PATCH 9/9] Use a better filename Signed-off-by: Evan Lloyd New-Schmidt --- .github/workflows/{ci.yml => rust-checks.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ci.yml => rust-checks.yml} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/rust-checks.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/rust-checks.yml -- 2.45.3