mirror of
https://github.com/NewFuture/DDNS.git
synced 2026-10-21 03:34:34 +00:00
* Initial plan * feat(install): add one-click installation script with multi-platform support Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(install): address review feedback - POSIX sh compatibility, multilingual support, API proxy, and CI tests Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(install): address feedback - simplify logic, update URLs, add OpenWrt testing, improve sudo handling Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * update scripts * mv test scripts * update test scirpts * update tests * fix tests * fix ci * update test * fix tests * set-ua * fix tests in docker * fix tests * fix version * fix version check * fix tests * fix proxy * fix tests * enhance download functionality with timeout and improved SSL handling * update proxy validation to use a real release asset for improved reliability * fix proxy * fix download result code * fix test proxy * fix ertry * fix retry * info message * update README and installation scripts to support remote URL and proxy configuration * wget 兼容 * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix libc detect * fix beta check --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> Co-authored-by: New Future <NewFuture@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
73 lines
2.7 KiB
Bash
Executable File
73 lines
2.7 KiB
Bash
Executable File
set -ex
|
|
platform=${1:-linux/amd64}
|
|
libc=${2:-musl}
|
|
filePath=${3:-dist/ddns}
|
|
|
|
volume=$(dirname $(realpath "$filePath"))
|
|
file=$(basename "$filePath")
|
|
MAP_CONF="${GITHUB_WORKSPACE}/tests/config:/config"
|
|
|
|
if [ "$libc" = "glibc" ]; then
|
|
container="ubuntu:19.04"
|
|
else
|
|
case $platform in
|
|
linux/amd64)
|
|
container="openwrt/rootfs:x86_64"
|
|
;;
|
|
linux/386 | linux/i386)
|
|
container="openwrt/rootfs:i386_pentium4"
|
|
platform="linux/i386_pentium4"
|
|
;;
|
|
linux/arm64)
|
|
container="openwrt/rootfs:aarch64_generic"
|
|
platform="linux/aarch64_generic"
|
|
;;
|
|
linux/arm/v8)
|
|
container="openwrt/rootfs:armsr-armv8"
|
|
platform="linux/aarch64_generic"
|
|
;;
|
|
linux/arm/v7)
|
|
container="openwrt/rootfs:armsr-armv7"
|
|
platform="linux/arm_cortex-a15_neon-vfpv4"
|
|
;;
|
|
linux/arm/v6)
|
|
# v6 不支持直接测试,需要qume仿真
|
|
echo "::warn::untested platform '$platform' ($libc)"
|
|
exit 0
|
|
;;
|
|
*)
|
|
container="alpine"
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
docker run --rm -v="$volume:/dist" --platform=$platform $container /dist/$file -h
|
|
docker run --rm -v="$volume:/dist" --platform=$platform $container /dist/$file --version
|
|
docker run --rm -v="$volume:/dist" --platform=$platform $container sh -c "/dist/$file || test -f config.json"
|
|
docker run --rm -v="$volume:/dist" -v="$MAP_CONF" --platform=$platform $container /dist/$file -c /config/callback.json
|
|
docker run --rm -v="$volume:/dist" -v="$MAP_CONF" --platform=$platform $container /dist/$file -c /config/debug.json
|
|
docker run --rm -v="$volume:/dist" -v="$MAP_CONF" --platform=$platform $container /dist/$file -c /config/noip.json
|
|
|
|
# Test task subcommand
|
|
echo "Testing task subcommand..."
|
|
docker run --rm -v="$volume:/dist" --platform=$platform $container /dist/$file task --help
|
|
docker run --rm -v="$volume:/dist" --platform=$platform $container /dist/$file task --status
|
|
|
|
# Test task functionality - auto-detect available scheduler
|
|
echo "Testing task management with auto-detection..."
|
|
TEST_SCRIPTS=$(dirname $(realpath "$0"))
|
|
|
|
# Determine if privileged mode is needed for systemd support
|
|
if [ "$libc" = "glibc" ]; then
|
|
# Skip task test in glibc environment due to systemd requiring privileged container
|
|
echo "Skipping task test in glibc environment (systemd requires privileged container)."
|
|
else
|
|
echo "Running task test cron..."
|
|
docker run --rm -v="$volume:/dist" -v="$TEST_SCRIPTS:/scripts" \
|
|
--platform=$platform $container /scripts/test-task-cron.sh /dist/$file
|
|
fi
|
|
|
|
|
|
# delete to avoid being reused
|
|
docker image rm $container
|