ci: utils submodule

This commit is contained in:
2024-02-07 18:27:30 +01:00
parent 7fe7284214
commit 6143d92ae5
10 changed files with 4057 additions and 31 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
/target target
/.vscode /.vscode
.env .env
/.idea /.idea
+3
View File
@@ -0,0 +1,3 @@
[submodule "utils"]
path = utils
url = https://github.com/yukkop/h.utils.git
+2 -1
View File
@@ -1,3 +1,4 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = ["crate/*"] members = ["crate/*"]
exclude = ["example/"]
+35 -28
View File
@@ -24,49 +24,56 @@ usage %s <path/to/Cargoctoml>\n
exit exit
fi fi
CARGO_PATH="$1"
if [ ! "$CARGO_PATH" ]; then
printf "please provide path to Cargo.toml\n"
exit
fi
if [ -d "$CARGO_PATH" ]; then
CARGO_PATH="${CARGO_PATH}/Cargo.toml"
fi
features=$(grep '^\[features\]' "$CARGO_PATH" -A99999999 | grep '^\[' -m 2 -B99999999 | grep -v '^\[' | cut -d '=' -f 1 | grep -v 'default')
generate_combinations() { generate_combinations() {
local items=($1) items="$1"
local size=$2 size=$2
local current=$3 current=$3
local combination=$4 combination="$4"
if [ $current -eq $size ]; then if [ "$current" -eq "$size" ]; then
echo "$combination" echo "$combination"
return return
fi fi
for ((i = 0; i < ${#items[@]}; ++i)); do # Split items into positional parameters
new_combination="$combination ${items[$i]}" set -- $items
remaining_items=("${items[@]:0:$i}" "${items[@]:$((i + 1))}") while [ $# -gt 0 ]; do
generate_combinations "$(IFS=" "; echo "${remaining_items[*]}")" $size $((current + 1)) "$new_combination" item=$1
shift
new_combination="$combination $item"
remaining_items="$@"
generate_combinations "$remaining_items" $size $(($current + 1)) "$new_combination"
set -- "$item" $@
done done
} }
for ((i = 1; i <= $(wc -w <<< "$features"); ++i)); do CARGO_PATH="$1"
if [ -z "$CARGO_PATH" ]; then
printf "please provide path to Cargo.toml\n"
exit
fi
if [ -d "$CARGO_PATH" ]; then
CARGO_PATH="${CARGO_PATH}/Cargo.toml"
fi
features=$(grep '^\[features\]' "$CARGO_PATH" -A99999999 | grep '^\[' -m 2 -B99999999 | grep -v '^\[' | cut -d '=' -f 1 | grep -v 'default')
num_features=$(echo "$features" | wc -w | tr -d ' ')
i=1
while [ $i -le $num_features ]; do
echo "Generating combinations of size $i" echo "Generating combinations of size $i"
combos=$(generate_combinations "$features" $i 0 "") combos=$(generate_combinations "$features" $i 0 "")
echo "$combos" | while read line echo "$combos" | while IFS= read -r line; do
do combo=$(echo $line | xargs) # Trim
echo "Running clippy with features: $line"
combo=$(echo $combo | xargs) # Trim
echo "Running clippy with features: $combo" echo "Running clippy with features: $combo"
if ! cargo clippy --features "$combo"; then if ! cargo clippy --features "$combo"; then
echo "Error found in combination: $combo" echo "Error found in combination: $combo"
exit 1 exit 1
fi fi
done done
i=$((i + 1))
done done
+3916
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "basic"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = "0.12.1"
bevy_controls = { path = "./../../crate/bevy_controls" }
+3
View File
@@ -0,0 +1,3 @@
fn main() {
}
Generated
+85
View File
@@ -0,0 +1,85 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1706191920,
"narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ae5c332cbb5827f6b1f02572496b141021de335f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1706235145,
"narHash": "sha256-3jh5nahTlcsX6QFcMPqxtLn9p9CgT9RSce5GLqjcpi4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "3a57c4e29cb2beb777b2e6ae7309a680585b8b2f",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+2
View File
@@ -23,6 +23,8 @@
nativeBuildInputs = with pkgs; [ rustToolchain pkg-config ]; nativeBuildInputs = with pkgs; [ rustToolchain pkg-config ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
openssl openssl
shellcheck
file
]; ];
in in
with pkgs; with pkgs;
Submodule
+1
Submodule utils added at 3939c913cc