mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* migrate from yarn to pnpm * feature-reporter: migrate from webpack to vite * remove unnecessary deps * bump pnpm to 10.32.1 * fix sitemap and favicon generator tools in docker * review and workflow fixes * fix pw test * update screenshots * update screenshot and add default maxDiffPixels value
54 lines
1.2 KiB
Bash
Executable File
54 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
test_folder="./test"
|
|
common_file="${test_folder}/.env.common"
|
|
|
|
# Generate ENV registry file
|
|
export NEXT_PUBLIC_GIT_COMMIT_SHA=$(git rev-parse --short HEAD)
|
|
export NEXT_PUBLIC_GIT_TAG=$(git describe --tags --abbrev=0)
|
|
../../scripts/collect_envs.sh ../../../docs/ENVS.md
|
|
|
|
# Copy test assets
|
|
mkdir -p "./public/assets/configs"
|
|
cp -r ${test_folder}/assets ./public/
|
|
|
|
# Build validator script
|
|
pnpm run build
|
|
|
|
validate_file() {
|
|
local test_file="$1"
|
|
local with_common="$2"
|
|
|
|
echo
|
|
echo "🧿 Validating file '$test_file'..."
|
|
|
|
if [ "$with_common" = "true" ]; then
|
|
dotenv -e "$test_file" -e "$common_file" pnpm run validate -- --silent
|
|
else
|
|
dotenv -e "$test_file" pnpm run validate -- --silent
|
|
fi
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "👍 All good!"
|
|
return 0
|
|
else
|
|
echo "🛑 The file is invalid. Please fix errors and run script again."
|
|
echo
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
test_files=($(find "$test_folder" -maxdepth 1 -type f | grep -vE '\/\.env\.common$'))
|
|
|
|
for file in "${test_files[@]}"; do
|
|
if [[ "$file" == *".env.multichain" ]]; then
|
|
validate_file "$file" false
|
|
else
|
|
validate_file "$file" true
|
|
fi
|
|
|
|
if [ $? -eq 1 ]; then
|
|
exit 1
|
|
fi
|
|
done
|