test: download desired Nimble sources

This commit is contained in:
Roman 2023-12-07 11:40:02 +01:00
parent 410dee4aa3
commit 3962ac7ad0
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 17 additions and 1 deletions

View File

@ -116,10 +116,11 @@ runs:
shell: ${{ inputs.shell }}
run: |
rm -rf nim
export NIMBLE_DIR=dist/nimble
cp ./scripts/build_nim.sh .
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ inputs.nim_branch }} \
QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \
bash build_nim.sh nim csources dist/my_nimble NONE
bash build_nim.sh nim csources ${NIMBLE_DIR} NimBinaries
# nimble install nimble -y
# ls -la nim/bin
# rm -rf nim/bin/nimble.exe

View File

@ -94,6 +94,21 @@ nim_needs_rebuilding() {
fi
popd >/dev/null
if [[ ! -d "$NIMBLE_DIR" ]]; then
mkdir -p "$NIMBLE_DIR"
pushd "$NIMBLE_DIR"
git clone https://github.com/nim-lang/nimble.git .
git checkout $NIMBLE_COMMIT
# we have to delete .git or koch.nim will checkout a branch tip, overriding our target commit
rm -rf .git
popd
fi
if [[ "$NIMBLE_DIR" != "dist/nimble" ]]; then
mkdir -p dist
rm -rf dist/nimble
ln -s ../"$NIMBLE_DIR" dist/nimble
fi
if [[ -n "$CI_CACHE" && -d "$CI_CACHE" ]]; then
cp -a "$CI_CACHE"/* "$NIM_DIR"/bin/ || true # let this one fail with an empty cache dir
fi