Skip to content

Commit e170fcd

Browse files
authored
Merge branch 'tweak/lint-security' into tweak/remove-notifications
2 parents a4e27ef + 15974c2 commit e170fcd

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/phpunit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ jobs:
6868
cp -r /tmp/wordpress-develop/tests/phpunit/* /tmp/wordpress-tests-lib/
6969
7070
if [ "${{ matrix.wp-version }}" = "latest" ]; then
71-
wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz
71+
WP_URL="https://wordpress.org/latest.tar.gz"
7272
else
73-
wget -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${{ matrix.wp-version }}.tar.gz
73+
WP_URL="https://wordpress.org/wordpress-${{ matrix.wp-version }}.tar.gz"
7474
fi
75+
for i in 1 2 3 4 5; do
76+
wget -nv -O /tmp/wordpress.tar.gz "$WP_URL" && break
77+
echo "Download attempt $i failed, retrying in $((i * 15))s..."
78+
sleep $((i * 15))
79+
done
7580
tar -xzf /tmp/wordpress.tar.gz -C /tmp/
7681
}
7782

bin/install-wp-tests.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
1818
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress}
1919

2020
download() {
21-
if [ `which curl` ]; then
22-
curl -s "$1" > "$2";
23-
elif [ `which wget` ]; then
24-
wget -nv -O "$2" "$1"
25-
fi
21+
local max_retries=5
22+
for i in $(seq 1 $max_retries); do
23+
if [ `which curl` ]; then
24+
curl -sSf --retry 3 --retry-delay 10 "$1" > "$2" && return 0
25+
elif [ `which wget` ]; then
26+
wget -nv --tries=3 --waitretry=10 -O "$2" "$1" && return 0
27+
fi
28+
echo "Download attempt $i/$max_retries failed for $1, retrying in $((i * 15))s..."
29+
sleep $((i * 15))
30+
done
31+
echo "All download attempts failed for $1"
32+
return 1
2633
}
2734

2835
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then

0 commit comments

Comments
 (0)