diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5bdf171..d2874cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -6,110 +6,109 @@ # - hack: check combinations of feature flags # - msrv: check that the msrv specified in the crate is correct permissions: - contents: read + contents: read # This configuration allows maintainers of this repo to create a branch and pull request based on # the new branch. Restricting the push trigger to the main branch ensures that the PR only gets # built once. on: - push: - branches: [main] - pull_request: - merge_group: + push: + branches: [main] + pull_request: + merge_group: # If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that # we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: check jobs: - fmt: - runs-on: ubuntu-latest - name: stable / fmt - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - name: cargo fmt --check - run: cargo fmt --check - clippy: - runs-on: ubuntu-latest - name: ${{ matrix.toolchain }} / clippy - permissions: - contents: read - checks: write - strategy: - fail-fast: false - matrix: - # Get early warning of new lints which are regularly introduced in beta channels. - toolchain: [stable, beta] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install ${{ matrix.toolchain }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.toolchain }} - components: clippy - - name: cargo clippy - uses: giraffate/clippy-action@v1 - with: - reporter: 'github-pr-check' - github_token: ${{ secrets.GITHUB_TOKEN }} - doc: - # run docs generation on nightly rather than stable. This enables features like - # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an - # API be documented as only available in some specific platforms. - runs-on: ubuntu-latest - name: nightly / doc - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - name: cargo doc - run: cargo doc --no-deps --all-features - env: - RUSTDOCFLAGS: --cfg docsrs - hack: - # cargo-hack checks combinations of feature flags to ensure that features are all additive - # which is required for feature unification - runs-on: ubuntu-latest - name: ubuntu / stable / features - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: cargo install cargo-hack - uses: taiki-e/install-action@cargo-hack - # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 - # --feature-powerset runs for every combination of features - - name: cargo hack - run: cargo hack --feature-powerset check - msrv: - # check that we can build using the minimal rust version that is specified by this crate - runs-on: ubuntu-latest - # we use a matrix here just because env can't be used in job names - # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability - strategy: - matrix: - msrv: ["1.56.1"] # 2021 edition requires 1.56 - name: ubuntu / ${{ matrix.msrv }} - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install ${{ matrix.msrv }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.msrv }} - - name: cargo +${{ matrix.msrv }} check - run: cargo check - \ No newline at end of file + fmt: + runs-on: ubuntu-latest + name: stable / fmt + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: cargo fmt --check + run: cargo fmt --check + clippy: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} / clippy + permissions: + contents: read + checks: write + strategy: + fail-fast: false + matrix: + # Get early warning of new lints which are regularly introduced in beta channels. + toolchain: [stable, beta] + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + components: clippy + - name: cargo clippy + uses: giraffate/clippy-action@v1 + with: + reporter: "github-pr-check" + github_token: ${{ secrets.GITHUB_TOKEN }} + doc: + # run docs generation on nightly rather than stable. This enables features like + # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an + # API be documented as only available in some specific platforms. + runs-on: ubuntu-latest + name: nightly / doc + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install nightly + uses: dtolnay/rust-toolchain@nightly + - name: cargo doc + run: cargo doc --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs + hack: + # cargo-hack checks combinations of feature flags to ensure that features are all additive + # which is required for feature unification + runs-on: ubuntu-latest + name: ubuntu / stable / features + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + - name: cargo install cargo-hack + uses: taiki-e/install-action@cargo-hack + # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 + # --feature-powerset runs for every combination of features + - name: cargo hack + run: cargo hack --feature-powerset check + msrv: + # check that we can build using the minimal rust version that is specified by this crate + runs-on: ubuntu-latest + # we use a matrix here just because env can't be used in job names + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability + strategy: + matrix: + msrv: ["1.74"] # 2021 edition requires 1.56 + name: ubuntu / ${{ matrix.msrv }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install ${{ matrix.msrv }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.msrv }} + - name: cargo +${{ matrix.msrv }} check + run: cargo check diff --git a/Cargo.lock b/Cargo.lock index ce8fd88..bfe5a48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -862,7 +862,6 @@ dependencies = [ "tracing-opentelemetry-instrumentation-sdk", "tracing-subscriber", "uuid", - "workspace-hack", ] [[package]] @@ -2383,7 +2382,6 @@ dependencies = [ "serde_json", "tracing", "unicode-segmentation", - "workspace-hack", ] [[package]] @@ -2406,7 +2404,6 @@ dependencies = [ "serde_json", "tokio", "tracing", - "workspace-hack", ] [[package]] @@ -3125,15 +3122,11 @@ name = "trie-map" version = "0.1.0" dependencies = [ "bytes", - "workspace-hack", ] [[package]] name = "trie-sketch" version = "0.1.0" -dependencies = [ - "workspace-hack", -] [[package]] name = "try-lock" @@ -3520,45 +3513,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "workspace-hack" -version = "0.1.0" -dependencies = [ - "ahash", - "either", - "futures-channel", - "futures-util", - "getrandom", - "indexmap 2.2.6", - "init-tracing-opentelemetry", - "log", - "num-traits", - "opentelemetry-http", - "opentelemetry-otlp", - "opentelemetry-proto", - "proc-macro2", - "quote", - "regex", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", - "reqwest", - "serde", - "serde_json", - "smallvec", - "syn 1.0.109", - "syn 2.0.55", - "time", - "time-macros", - "tokio", - "tower", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index 181b551..682e61d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,6 @@ sblex-server = { path = "./crates/sblex-server" } sblex-telemetry = { path = "./crates/sblex-telemetry" } trie-map = { path = "./crates/trie-map" } trie-sketch = { path = "./crates/trie-sketch" } -workspace-hack = { path = "./crates/workspace-hack" } # extern crates ahash = "0.8" @@ -22,7 +21,7 @@ aide = { version = "0.13.1", features = [ "redoc", ] } arcstr = "1.1.5" -async-trait = "0.1.57" +async-trait = "0.1.67" axum = { version = "0.7.3", features = ["macros"] } axum-extra = "0.9.0" axum-jsonschema = { version = "0.8.0", features = ["aide"] } diff --git a/crates/fm-server/Cargo.toml b/crates/fm-server/Cargo.toml index 57d36e0..392fbcd 100644 --- a/crates/fm-server/Cargo.toml +++ b/crates/fm-server/Cargo.toml @@ -48,7 +48,6 @@ uuid.workspace = true # local deps sblex.workspace = true sblex-telemetry.workspace = true -workspace-hack.workspace = true # opentelemetry-stdout = { version = "0.3.0", features = [ # "trace", @@ -63,6 +62,3 @@ workspace-hack.workspace = true eyre.workspace = true reqwest.workspace = true insta.workspace = true - -[package.metadata.cargo-machete] -ignored = ["workspace-hack"] diff --git a/crates/sblex-server/Cargo.toml b/crates/sblex-server/Cargo.toml index ccfbabc..feabed4 100644 --- a/crates/sblex-server/Cargo.toml +++ b/crates/sblex-server/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" [dependencies] # local deps sblex-telemetry.workspace = true -workspace-hack = { version = "0.1", path = "../workspace-hack" } # external deps axum = { workspace = true } @@ -31,6 +30,3 @@ tracing = { workspace = true } httpc-test = { workspace = true } reqwest = { workspace = true, features = ["json"] } rstest = { workspace = true } - -[package.metadata.cargo-machete] -ignored = ["workspace-hack"] diff --git a/crates/sblex/Cargo.toml b/crates/sblex/Cargo.toml index 690529a..0a3b4fe 100644 --- a/crates/sblex/Cargo.toml +++ b/crates/sblex/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] # local deps -workspace-hack = { version = "0.1", path = "../workspace-hack" } # external deps arcstr = { workspace = true, features = ["serde"] } @@ -19,6 +18,3 @@ unicode-segmentation = { workspace = true } [dev-dependencies] eyre = { workspace = true } - -[package.metadata.cargo-machete] -ignored = ["workspace-hack"] diff --git a/crates/trie-map/Cargo.toml b/crates/trie-map/Cargo.toml index 5438309..e87fac2 100644 --- a/crates/trie-map/Cargo.toml +++ b/crates/trie-map/Cargo.toml @@ -9,7 +9,3 @@ edition = "2021" bytes.workspace = true # local deps -workspace-hack.workspace = true - -[package.metadata.cargo-machete] -ignored = ["workspace-hack"] diff --git a/crates/trie-sketch/Cargo.toml b/crates/trie-sketch/Cargo.toml index 345db86..08c8a71 100644 --- a/crates/trie-sketch/Cargo.toml +++ b/crates/trie-sketch/Cargo.toml @@ -7,7 +7,3 @@ edition = "2021" [dependencies] # local deps -workspace-hack.workspace = true - -[package.metadata.cargo-machete] -ignored = ["workspace-hack"] diff --git a/crates/workspace-hack/.gitattributes b/crates/workspace-hack/.gitattributes deleted file mode 100644 index 3e9dba4..0000000 --- a/crates/workspace-hack/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -# Avoid putting conflict markers in the generated Cargo.toml file, since their presence breaks -# Cargo. -# Also do not check out the file as CRLF on Windows, as that's what hakari needs. -Cargo.toml merge=binary -crlf diff --git a/crates/workspace-hack/Cargo.toml b/crates/workspace-hack/Cargo.toml deleted file mode 100644 index 747a1f1..0000000 --- a/crates/workspace-hack/Cargo.toml +++ /dev/null @@ -1,100 +0,0 @@ -# This file is generated by `cargo hakari`. -# To regenerate, run: -# cargo hakari generate - -[package] -name = "workspace-hack" -version = "0.1.0" -description = "workspace-hack package, managed by hakari" -# You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing. -publish = false -edition = "2021" - -# The parts of the file between the BEGIN HAKARI SECTION and END HAKARI SECTION comments -# are managed by hakari. - -### BEGIN HAKARI SECTION -[dependencies] -ahash = { workspace = true, features = ["serde"] } -either = { workspace = true, features = ["use_std"] } -futures-channel = { workspace = true, features = ["sink"] } -futures-util = { workspace = true, features = [ - "async-await-macro", - "channel", - "io", - "sink", -] } -getrandom = { workspace = true, features = ["std"] } -indexmap = { workspace = true, features = ["serde"] } -init-tracing-opentelemetry = { workspace = true, features = [ - "stdout", - "tracing_subscriber_ext", -] } -log = { workspace = true, features = ["std"] } -num-traits = { workspace = true, features = ["i128", "std"] } -opentelemetry-http = { workspace = true, features = ["reqwest"] } -opentelemetry-otlp = { workspace = true, features = [ - "http-proto", - "reqwest-client", - "reqwest-rustls", -] } -opentelemetry-proto = { workspace = true, features = [ - "gen-tonic", - "metrics", - "trace", -] } -regex = { workspace = true } -regex-automata = { workspace = true, features = [ - "dfa-onepass", - "hybrid", - "meta", - "nfa-backtrack", - "perf-inline", - "perf-literal", - "unicode", -] } -regex-syntax = { workspace = true } -reqwest = { workspace = true, features = [ - "blocking", - "cookies", - "json", - "rustls-tls-native-roots", -] } -serde = { workspace = true, features = ["derive", "rc"] } -serde_json = { workspace = true, features = ["raw_value"] } -smallvec = { workspace = true, features = ["const_new"] } -time = { workspace = true, features = ["formatting", "macros", "parsing"] } -tokio = { workspace = true, features = ["full"] } -tower = { workspace = true, features = [ - "balance", - "buffer", - "limit", - "timeout", - "util", -] } -tracing = { workspace = true, features = ["log"] } -tracing-core = { workspace = true } -tracing-log = { workspace = true, features = ["log-tracer", "std"] } -tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } -unicode-bidi = { workspace = true } -unicode-normalization = { workspace = true } - -[build-dependencies] -either = { workspace = true, features = ["use_std"] } -getrandom = { workspace = true, features = ["std"] } -proc-macro2 = { workspace = true } -quote = { workspace = true } -syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = [ - "extra-traits", - "full", - "visit", - "visit-mut", -] } -syn-f595c2ba2a3f28df = { package = "syn", version = "2", features = [ - "extra-traits", - "full", - "visit-mut", -] } -time-macros = { workspace = true, features = ["formatting", "parsing"] } - -### END HAKARI SECTION diff --git a/crates/workspace-hack/build.rs b/crates/workspace-hack/build.rs deleted file mode 100644 index 92518ef..0000000 --- a/crates/workspace-hack/build.rs +++ /dev/null @@ -1,2 +0,0 @@ -// A build script is required for cargo to consider build dependencies. -fn main() {} diff --git a/crates/workspace-hack/src/lib.rs b/crates/workspace-hack/src/lib.rs deleted file mode 100644 index 22489f6..0000000 --- a/crates/workspace-hack/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -// This is a stub lib.rs.