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
+1 -1
View File
@@ -1,4 +1,4 @@
/target
target
/.vscode
.env
/.idea
+3
View File
@@ -0,0 +1,3 @@
[submodule "utils"]
path = utils
url = https://github.com/yukkop/h.utils.git
+1
View File
@@ -1,3 +1,4 @@
[workspace]
resolver = "2"
members = ["crate/*"]
exclude = ["example/"]
+30 -23
View File
@@ -24,9 +24,32 @@ usage %s <path/to/Cargoctoml>\n
exit
fi
generate_combinations() {
items="$1"
size=$2
current=$3
combination="$4"
if [ "$current" -eq "$size" ]; then
echo "$combination"
return
fi
# Split items into positional parameters
set -- $items
while [ $# -gt 0 ]; do
item=$1
shift
new_combination="$combination $item"
remaining_items="$@"
generate_combinations "$remaining_items" $size $(($current + 1)) "$new_combination"
set -- "$item" $@
done
}
CARGO_PATH="$1"
if [ ! "$CARGO_PATH" ]; then
if [ -z "$CARGO_PATH" ]; then
printf "please provide path to Cargo.toml\n"
exit
fi
@@ -36,37 +59,21 @@ if [ -d "$CARGO_PATH" ]; then
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 ' ')
generate_combinations() {
local items=($1)
local size=$2
local current=$3
local combination=$4
if [ $current -eq $size ]; then
echo "$combination"
return
fi
for ((i = 0; i < ${#items[@]}; ++i)); do
new_combination="$combination ${items[$i]}"
remaining_items=("${items[@]:0:$i}" "${items[@]:$((i + 1))}")
generate_combinations "$(IFS=" "; echo "${remaining_items[*]}")" $size $((current + 1)) "$new_combination"
done
}
for ((i = 1; i <= $(wc -w <<< "$features"); ++i)); do
i=1
while [ $i -le $num_features ]; do
echo "Generating combinations of size $i"
combos=$(generate_combinations "$features" $i 0 "")
echo "$combos" | while read line
do
echo "Running clippy with features: $line"
combo=$(echo $combo | xargs) # Trim
echo "$combos" | while IFS= read -r line; do
combo=$(echo $line | xargs) # Trim
echo "Running clippy with features: $combo"
if ! cargo clippy --features "$combo"; then
echo "Error found in combination: $combo"
exit 1
fi
done
i=$((i + 1))
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 ];
buildInputs = with pkgs; [
openssl
shellcheck
file
];
in
with pkgs;
Submodule
+1
Submodule utils added at 3939c913cc