mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Only cache dependency directories instead of whole test/
Otherwise, changes made to the test suite are not picked up
This commit is contained in:
45
.github/workflows/testing.yml
vendored
45
.github/workflows/testing.yml
vendored
@@ -55,13 +55,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.buildsys }}
|
name: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.buildsys }}
|
||||||
path: bins
|
path: bins
|
||||||
|
- name: Compute test dependency cache params
|
||||||
|
id: test-deps-cache-params
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
paths=$(test/fetch-test-deps.sh --get-paths)
|
||||||
|
hash=$(test/fetch-test-deps.sh --get-hash)
|
||||||
|
tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT
|
||||||
|
tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT
|
||||||
- name: Check test dependency repositories cache
|
- name: Check test dependency repositories cache
|
||||||
id: test-deps-cache
|
id: test-deps-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: test
|
path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }}
|
||||||
key: ${{ matrix.os }}-${{ hashFiles('test/fetch-test-deps.sh') }}
|
key: ${{ matrix.os }}-${{ steps.test-deps-cache-params.outputs.hash }}
|
||||||
- if: ${{ steps.test-deps-cache.outputs.cache-hit != 'true' }}
|
- if: steps.test-deps-cache.outputs.cache-hit != 'true'
|
||||||
name: Fetch test dependency repositories
|
name: Fetch test dependency repositories
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
@@ -127,16 +135,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: rgbds-canary-win${{ matrix.bits }}
|
name: rgbds-canary-win${{ matrix.bits }}
|
||||||
path: bins
|
path: bins
|
||||||
|
- name: Compute test dependency cache params
|
||||||
|
id: test-deps-cache-params
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
paths=$(test/fetch-test-deps.sh --get-paths)
|
||||||
|
hash=$(test/fetch-test-deps.sh --get-hash)
|
||||||
|
tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT
|
||||||
|
tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT
|
||||||
- name: Check test dependency repositories cache
|
- name: Check test dependency repositories cache
|
||||||
id: test-deps-cache
|
id: test-deps-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: test
|
path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }}
|
||||||
# Intentionally using matrix.bits instead matrix.arch as it's fine to share a cache
|
key: ${{ matrix.os }}-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }}
|
||||||
# with a different job below that also runs on Windows but doesn't have arch property
|
- if: steps.test-deps-cache.outputs.cache-hit != 'true'
|
||||||
# defined.
|
|
||||||
key: ${{ matrix.os }}-${{ matrix.bits }}-${{ hashFiles('test/fetch-test-deps.sh') }}
|
|
||||||
- if: ${{ steps.test-deps-cache.outputs.cache-hit != 'true' }}
|
|
||||||
name: Fetch test dependency repositories
|
name: Fetch test dependency repositories
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -224,13 +237,21 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp bins/* .
|
cp bins/* .
|
||||||
cp bins/*.dll test/gfx
|
cp bins/*.dll test/gfx
|
||||||
|
- name: Compute test dependency cache params
|
||||||
|
id: test-deps-cache-params
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
paths=$(test/fetch-test-deps.sh --get-paths)
|
||||||
|
hash=$(test/fetch-test-deps.sh --get-hash)
|
||||||
|
tee -a <<<"paths=\"${paths//,/\\n}\"" $GITHUB_OUTPUT
|
||||||
|
tee -a <<<"hash=${hash%-}" $GITHUB_OUTPUT
|
||||||
- name: Check test dependency repositories cache
|
- name: Check test dependency repositories cache
|
||||||
id: test-deps-cache
|
id: test-deps-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: test
|
path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }}
|
||||||
key: ${{ matrix.os }}-${{ matrix.bits }}-${{ hashFiles('test/fetch-test-deps.sh') }}
|
key: mingw-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }}
|
||||||
- if: ${{ steps.test-deps-cache.outputs.cache-hit != 'true' }}
|
- if: steps.test-deps-cache.outputs.cache-hit != 'true'
|
||||||
name: Fetch test dependency repositories
|
name: Fetch test dependency repositories
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
@@ -4,9 +4,23 @@ set -e
|
|||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--get-hash)
|
||||||
|
action() { # owner/repo shallow-since commit
|
||||||
|
printf "%s@%s-" "${1##*/}" "$3"
|
||||||
|
}
|
||||||
|
;;
|
||||||
|
|
||||||
|
--get-paths)
|
||||||
|
action() { # owner/repo shallow-since commit
|
||||||
|
printf "test/%s," "${1##*/}"
|
||||||
|
}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
echo "Fetching test dependency repositories"
|
echo "Fetching test dependency repositories"
|
||||||
|
|
||||||
fetch_downstream() { # owner/repo shallow-since commit
|
action() { # owner/repo shallow-since commit
|
||||||
if [ ! -d ${1##*/} ]; then
|
if [ ! -d ${1##*/} ]; then
|
||||||
git clone https://github.com/$1.git --shallow-since=$2 --single-branch
|
git clone https://github.com/$1.git --shallow-since=$2 --single-branch
|
||||||
fi
|
fi
|
||||||
@@ -17,7 +31,8 @@ fetch_downstream() { # owner/repo shallow-since commit
|
|||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
esac
|
||||||
|
|
||||||
fetch_downstream pret/pokecrystal 2022-09-29 70a3ec1accb6de1c1c273470af0ddfa2edc1b0a9
|
action pret/pokecrystal 2022-09-29 70a3ec1accb6de1c1c273470af0ddfa2edc1b0a9
|
||||||
fetch_downstream pret/pokered 2022-09-29 2b52ceb718b55dce038db24d177715ae4281d065
|
action pret/pokered 2022-09-29 2b52ceb718b55dce038db24d177715ae4281d065
|
||||||
fetch_downstream AntonioND/ucity 2022-04-20 d8878233da7a6569f09f87b144cb5bf140146a0f
|
action AntonioND/ucity 2022-04-20 d8878233da7a6569f09f87b144cb5bf140146a0f
|
||||||
|
|||||||
Reference in New Issue
Block a user