Skip to content

Commit 792b4c5

Browse files
authored
build: set up workspace layout (#43)
* build: set up workspace layout Signed-off-by: tison <[email protected]> * fixup Signed-off-by: tison <[email protected]> * try fix windows compile Signed-off-by: tison <[email protected]> * fix(xtask): exclude xtask binary from build command to avoid file locking on Windows * workaround windows issue Signed-off-by: tison <[email protected]> * windows runner has no yq Signed-off-by: tison <[email protected]> --------- Signed-off-by: tison <[email protected]>
1 parent 560b83e commit 792b4c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+566
-43
lines changed

.cargo/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[alias]
19+
x = "run --package x --"
20+
21+
[env]
22+
CARGO_WORKSPACE_DIR = { value = "", relative = true }

.github/workflows/ci.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ on:
3434
concurrency:
3535
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
3636
cancel-in-progress: true
37+
38+
env:
39+
RUST_BACKTRACE: 1
40+
3741
jobs:
3842
check:
3943
name: Check
@@ -49,12 +53,7 @@ jobs:
4953
with:
5054
tool: typos-cli,taplo-cli,hawkeye
5155
- name: Check all
52-
run: |
53-
hawkeye check
54-
taplo format --check
55-
typos
56-
cargo +nightly fmt --all -- --check
57-
cargo +nightly clippy --all-targets --all-features -- -D warnings
56+
run: cargo x lint
5857

5958
msrv:
6059
name: Resolve MSRV
@@ -65,7 +64,7 @@ jobs:
6564
- uses: actions/checkout@v6
6665
- id: metadata
6766
run: |
68-
msrv=$(yq '.package.rust-version' Cargo.toml)
67+
msrv=$(yq '.workspace.package.rust-version' Cargo.toml)
6968
echo "MSRV: $msrv"
7069
echo "rust-versions=[\"${msrv}\", \"stable\"]" >> "$GITHUB_OUTPUT"
7170
@@ -94,16 +93,18 @@ jobs:
9493
- name: Prepare test data
9594
shell: bash
9695
run: ./tools/generate_serialization_test_data.py
97-
- name: Build
98-
run: cargo build --workspace --all-features --bins --tests --examples --benches --lib
9996
- name: Run unit tests
10097
shell: bash
101-
run: cargo test --all-features -- --nocapture
98+
run: cargo x test
10299
- name: Run examples
103100
shell: bash
101+
working-directory: examples
104102
run: |
105103
set -x
106-
cargo run --example hll_usage
104+
EXAMPLES=( hll_update )
105+
for example in $EXAMPLES; do
106+
cargo run --bin "$example"
107+
done
107108
108109
required:
109110
name: Required

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ cargo version
3030
# cargo 1.85.0 (<hash> 2024-12-31)
3131
```
3232

33-
To keep code style consistent, we use the following tools:
34-
35-
* Nightly `rustfmt` for code formatting: `cargo +nightly fmt --all -- --check`
36-
* Nightly `clippy` for linting: `cargo +nightly clippy --all-targets --all-features -- -D warnings`
37-
* [`typos`](https://github.com/crate-ci/typos) for spell checking: `cargo install typos-cli` and then `typos`
38-
* [`taplo`](https://taplo.tamasfe.dev/) for checking `toml` files: `cargo install taplo-cli` and then `taplo check`
39-
* [`hawkeye`](https://github.com/korandoru/hawkeye) for checking license header: `cargo install hawkeye` and then `hawkeye check`
33+
To keep code style consistent, run `cargo x lint --fix` to automatically fix any style issues before committing your changes.
4034

4135
## Code of Conduct
4236

Cargo.lock

Lines changed: 220 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)