#1082 Add cache check for external repositories used during testing (#1100)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
This commit is contained in:
Robert Lewicki
2022-10-25 08:39:19 +02:00
committed by GitHub
parent 48248faab0
commit 1a9fc964df
3 changed files with 66 additions and 12 deletions

23
test/fetch-test-deps.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
echo "Fetching test dependency repositories"
fetch_downstream() { # owner/repo shallow-since commit
if [ ! -d ${1##*/} ]; then
git clone https://github.com/$1.git --shallow-since=$2 --single-branch
fi
pushd ${1##*/}
git checkout -f $3
if [ -f ../patches/${1##*/}.patch ]; then
git apply --ignore-whitespace ../patches/${1##*/}.patch
fi
popd
}
fetch_downstream pret/pokecrystal 2022-09-29 70a3ec1accb6de1c1c273470af0ddfa2edc1b0a9
fetch_downstream pret/pokered 2022-09-29 2b52ceb718b55dce038db24d177715ae4281d065
fetch_downstream AntonioND/ucity 2022-04-20 d8878233da7a6569f09f87b144cb5bf140146a0f

View File

@@ -25,20 +25,16 @@ done
# When updating subprojects, change the commit being checked out, and set the `shallow-since`
# to the day before, to reduce the amount of refs being transferred and thus speed up CI.
test_downstream() { # owner/repo shallow-since commit make-target
if [ ! -d ${1##*/} ]; then
git clone https://github.com/$1.git --shallow-since=$2 --single-branch
fi
pushd ${1##*/}
git checkout -f $3
if [ -f ../patches/${1##*/}.patch ]; then
git apply --ignore-whitespace ../patches/${1##*/}.patch
test_downstream() { # owner/repo make-target
if ! pushd ${1##*/}; then
echo >&2 'Please run `fetch-test-deps.sh` before running the test suite'
return 1
fi
make clean
make -j4 $4 RGBDS=../../
make -j4 $2 RGBDS=../../
popd
}
test_downstream pret/pokecrystal 2022-09-29 70a3ec1accb6de1c1c273470af0ddfa2edc1b0a9 compare
test_downstream pret/pokered 2022-09-29 2b52ceb718b55dce038db24d177715ae4281d065 compare
test_downstream AntonioND/ucity 2022-04-20 d8878233da7a6569f09f87b144cb5bf140146a0f ''
test_downstream pret/pokecrystal compare
test_downstream pret/pokered compare
test_downstream AntonioND/ucity ''