ci: fix dependencies
This commit is contained in:
@@ -4,7 +4,7 @@ sh_test(
|
||||
name = "phase8_ci_matrix_shape_test",
|
||||
size = "small",
|
||||
srcs = ["phase8_ci_matrix_shape_test.sh"],
|
||||
args = ["$(location //.github/workflows:ci.yml)"],
|
||||
args = ["$(rlocationpath //.github/workflows:ci.yml)"],
|
||||
data = ["//.github/workflows:ci.yml"],
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ sh_test(
|
||||
name = "phase8_ci_targets_test",
|
||||
size = "small",
|
||||
srcs = ["phase8_ci_targets_test.sh"],
|
||||
args = ["$(location :phase8_ci_targets.sh)"],
|
||||
args = ["$(rlocationpath :phase8_ci_targets.sh)"],
|
||||
data = [":phase8_ci_targets.sh"],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
workflow_file="$1"
|
||||
if [[ -z ${RUNFILES_DIR:-} && -n ${TEST_SRCDIR:-} && -d ${TEST_SRCDIR} ]]; then
|
||||
RUNFILES_DIR="${TEST_SRCDIR}"
|
||||
fi
|
||||
if [[ -z ${RUNFILES_DIR:-} && -z ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
if [[ -d "$0.runfiles" ]]; then
|
||||
RUNFILES_DIR="$0.runfiles"
|
||||
elif [[ -f "$0.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
|
||||
elif [[ -f "$0.exe.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.exe.runfiles_manifest"
|
||||
fi
|
||||
fi
|
||||
|
||||
resolve_runfile() {
|
||||
local path="${1:-}"
|
||||
local candidate
|
||||
local resolved
|
||||
|
||||
if [[ -z ${path} ]]; then
|
||||
echo "Error: missing runfile path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ${path} == /* || ${path} =~ ^[A-Za-z]:[\\/] ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -e ${path} ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for candidate in \
|
||||
"${path}" \
|
||||
"${TEST_WORKSPACE:-}/${path}" \
|
||||
"_main/${path}"; do
|
||||
[[ -z ${candidate} ]] && continue
|
||||
if [[ -n ${RUNFILES_DIR:-} && -e "${RUNFILES_DIR}/${candidate}" ]]; then
|
||||
printf '%s\n' "${RUNFILES_DIR}/${candidate}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
resolved="$(
|
||||
awk -v key="${candidate}" 'index($0, key " ") == 1 { print substr($0, length(key) + 2); exit }' \
|
||||
"${RUNFILES_MANIFEST_FILE}"
|
||||
)"
|
||||
if [[ -n ${resolved} ]]; then
|
||||
printf '%s\n' "${resolved}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Error: unable to resolve runfile: ${path}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
workflow_file="$(resolve_runfile "${1:-}")"
|
||||
if [ -z "${workflow_file}" ]; then
|
||||
echo "Error: workflow file path required as first argument" >&2
|
||||
exit 1
|
||||
|
||||
@@ -1,7 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
resolver="${1:-}"
|
||||
if [[ -z ${RUNFILES_DIR:-} && -n ${TEST_SRCDIR:-} && -d ${TEST_SRCDIR} ]]; then
|
||||
RUNFILES_DIR="${TEST_SRCDIR}"
|
||||
fi
|
||||
if [[ -z ${RUNFILES_DIR:-} && -z ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
if [[ -d "$0.runfiles" ]]; then
|
||||
RUNFILES_DIR="$0.runfiles"
|
||||
elif [[ -f "$0.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
|
||||
elif [[ -f "$0.exe.runfiles_manifest" ]]; then
|
||||
RUNFILES_MANIFEST_FILE="$0.exe.runfiles_manifest"
|
||||
fi
|
||||
fi
|
||||
|
||||
resolve_runfile() {
|
||||
local path="${1:-}"
|
||||
local candidate
|
||||
local resolved
|
||||
|
||||
if [[ -z ${path} ]]; then
|
||||
echo "Error: missing runfile path" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ${path} == /* || ${path} =~ ^[A-Za-z]:[\\/] ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -e ${path} ]]; then
|
||||
printf '%s\n' "${path}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for candidate in \
|
||||
"${path}" \
|
||||
"${TEST_WORKSPACE:-}/${path}" \
|
||||
"_main/${path}"; do
|
||||
[[ -z ${candidate} ]] && continue
|
||||
if [[ -n ${RUNFILES_DIR:-} && -e "${RUNFILES_DIR}/${candidate}" ]]; then
|
||||
printf '%s\n' "${RUNFILES_DIR}/${candidate}"
|
||||
return 0
|
||||
fi
|
||||
if [[ -n ${RUNFILES_MANIFEST_FILE:-} ]]; then
|
||||
resolved="$(
|
||||
awk -v key="${candidate}" 'index($0, key " ") == 1 { print substr($0, length(key) + 2); exit }' \
|
||||
"${RUNFILES_MANIFEST_FILE}"
|
||||
)"
|
||||
if [[ -n ${resolved} ]]; then
|
||||
printf '%s\n' "${resolved}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Error: unable to resolve runfile: ${path}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
resolver="$(resolve_runfile "${1:-}")"
|
||||
if [[ -z ${resolver} ]]; then
|
||||
echo "Error: resolver path required as first argument" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user