mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-13 01:20:06 +00:00
fix: really do the move
This commit is contained in:
parent
cf70ca862e
commit
0c3f353a54
30 changed files with 164 additions and 44144 deletions
22
dist/scripts/determine_os.sh
vendored
Executable file
22
dist/scripts/determine_os.sh
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
family=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
codecov_os="windows"
|
||||
[[ $family == "darwin" ]] && codecov_os="macos"
|
||||
|
||||
[[ $family == "linux" ]] && codecov_os="linux"
|
||||
[[ $codecov_os == "linux" ]] && \
|
||||
osID=$(grep -e "^ID=" /etc/os-release | cut -c4-)
|
||||
[[ $osID == "alpine" ]] && codecov_os="alpine"
|
||||
echo "Detected ${codecov_os}"
|
||||
echo "export codecov_os=${codecov_os}" >> $BASH_ENV
|
||||
echo "export codecov_version=${PARAM_VERSION}" >> $BASH_ENV
|
||||
|
||||
codecov_filename="codecov"
|
||||
[[ $codecov_os == "windows" ]] && codecov_filename+=".exe"
|
||||
echo "export codecov_filename=${codecov_filename}" >> $BASH_ENV
|
||||
[[ $codecov_os == "macos" ]] && \
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg
|
||||
codecov_url="https://cli.codecov.io"
|
||||
codecov_url="$codecov_url/${PARAM_VERSION}"
|
||||
codecov_url="$codecov_url/${codecov_os}/${codecov_filename}"
|
||||
echo "Downloading ${codecov_url}"
|
||||
curl -Os $codecov_url -v
|
||||
22
dist/scripts/download.sh
vendored
Executable file
22
dist/scripts/download.sh
vendored
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
family=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
codecov_os="windows"
|
||||
[[ $family == "darwin" ]] && codecov_os="macos"
|
||||
|
||||
[[ $family == "linux" ]] && codecov_os="linux"
|
||||
[[ $codecov_os == "linux" ]] && \
|
||||
osID=$(grep -e "^ID=" /etc/os-release | cut -c4-)
|
||||
[[ $osID == "alpine" ]] && codecov_os="alpine"
|
||||
echo "Detected ${codecov_os}"
|
||||
echo "export codecov_os=${codecov_os}" >> $BASH_ENV
|
||||
echo "export codecov_version=${PARAM_VERSION}" >> $BASH_ENV
|
||||
|
||||
codecov_filename="codecov"
|
||||
[[ $codecov_os == "windows" ]] && codecov_filename+=".exe"
|
||||
echo "export codecov_filename=${codecov_filename}" >> $BASH_ENV
|
||||
[[ $codecov_os == "macos" ]] && \
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install gpg
|
||||
codecov_url="https://cli.codecov.io"
|
||||
codecov_url="$codecov_url/${PARAM_VERSION}"
|
||||
codecov_url="$codecov_url/${codecov_os}/${codecov_filename}"
|
||||
echo "Downloading ${codecov_url}"
|
||||
curl -Os $codecov_url -v
|
||||
1
dist/scripts/test.sh
vendored
Executable file
1
dist/scripts/test.sh
vendored
Executable file
|
|
@ -0,0 +1 @@
|
|||
echo "meow"
|
||||
64
dist/scripts/upload.sh
vendored
Executable file
64
dist/scripts/upload.sh
vendored
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
unset NODE_OPTIONS
|
||||
# See https://github.com/codecov/uploader/issues/475
|
||||
source $BASH_ENV
|
||||
|
||||
chmod +x $codecov_filename
|
||||
[ -n "${PARAM_FILE}" ] && \
|
||||
set - "${@}" "-f" "${PARAM_FILE}"
|
||||
[ -n "${PARAM_UPLOAD_ARGS}" ] && \
|
||||
set - "${@}" "${PARAM_UPLOAD_ARGS}"
|
||||
|
||||
if [ -z "${PARAM_UPLOAD_NAME}" ]; then
|
||||
PARAM_UPLOAD_NAME="${CIRCLE_BUILD_NUM}"
|
||||
fi
|
||||
|
||||
FLAGS=""
|
||||
OLDIFS=$IFS;IFS=,
|
||||
for flag in $PARAM_FLAGS; do
|
||||
eval e="\$$flag"
|
||||
for param in "${e}" "${flag}"; do
|
||||
if [ -n "${param}" ]; then
|
||||
if [ -n "${FLAGS}" ]; then
|
||||
FLAGS="${FLAGS},${param}"
|
||||
else
|
||||
FLAGS="${param}"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$OLDIFS
|
||||
|
||||
if [ -n "$FLAGS" ]; then
|
||||
FLAGS="-F ${FLAGS}"
|
||||
fi
|
||||
|
||||
#create commit
|
||||
echo "./\"$codecov_filename\" ${PARAM_CLI_ARGS} create-commit -t <redacted>"
|
||||
|
||||
./"$codecov_filename" \
|
||||
${PARAM_CLI_ARGS} \
|
||||
create-commit \
|
||||
-t "$(eval echo \$$PARAM_TOKEN)"
|
||||
|
||||
#create report
|
||||
echo "./\"$codecov_filename\" ${PARAM_CLI_ARGS} create-report -t <redacted>"
|
||||
|
||||
./"$codecov_filename" \
|
||||
${PARAM_CLI_ARGS} \
|
||||
create-report \
|
||||
-t "$(eval echo \$$PARAM_TOKEN)"
|
||||
|
||||
#upload reports
|
||||
# alpine doesn't allow for indirect expansion
|
||||
|
||||
echo "./${codecov_filename} ${PARAM_CLI_ARGS} do-upload -t <redacted> -n \"${PARAM_UPLOAD_NAME}\" ${FLAGS} ${PARAM_UPLOAD_ARGS} ${@}"
|
||||
|
||||
./"$codecov_filename" \
|
||||
${PARAM_CLI_ARGS} \
|
||||
do-upload \
|
||||
-t "$(eval echo \$$PARAM_TOKEN)" \
|
||||
-n "${PARAM_UPLOAD_NAME}" \
|
||||
${FLAGS} \
|
||||
${PARAM_UPLOAD_ARGS} \
|
||||
${@}
|
||||
13
dist/scripts/validate.sh
vendored
Executable file
13
dist/scripts/validate.sh
vendored
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
source "$BASH_ENV"
|
||||
echo "${CODECOV_PUBLIC_PGP_KEY}" | \
|
||||
gpg --no-default-keyring --keyring trustedkeys.kbx --import
|
||||
# One-time step
|
||||
sha_url="https://cli.codecov.io"
|
||||
sha_url="${sha_url}/${codecov_version}/${codecov_os}"
|
||||
sha_url="${sha_url}/${codecov_filename}.SHA256SUM"
|
||||
echo "Downloading ${sha_url}"
|
||||
curl -Os "$sha_url"
|
||||
curl -Os "${sha_url}.sig"
|
||||
gpgv "${codecov_filename}.SHA256SUM.sig" "${codecov_filename}.SHA256SUM"
|
||||
shasum -a 256 -c "${codecov_filename}.SHA256SUM" || \
|
||||
sha256sum -c "${codecov_filename}.SHA256SUM"
|
||||
Loading…
Add table
Add a link
Reference in a new issue