mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
* [antithesis] Propose initial test setup * fixup: Simplify generation of docker compose artifacts * fixup: Ensure images will be pushed * fixup: Update to use refactored antithesis tooling from avalanchego * fixup: Update workload to use tmpnet * fixup: Add workload sanity check to CI job * fixup: Resolved workload errors * fixup: Generate deterministic keys * fixup: Fix invocation of gen_antithesis_compose_config * fixup: Update to use StoppedTimer * fixup: Respond to review feedback * fixup: Move embedded comment out of trigger action * fixup: Get image build test passing * fixup: Update how runtime plugin dir is provided * fixup: Update avalanchego version
56 lines
1.8 KiB
Bash
Executable File
56 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
VERSION="v0.9.0"
|
|
|
|
# Scripts that are sourced from upstream and not maintained in this repo will not be shellchecked.
|
|
# Also ignore the local avalanchego clone.
|
|
IGNORED_FILES="
|
|
cmd/evm/transition-test.sh
|
|
metrics/validate.sh
|
|
avalanchego/*
|
|
"
|
|
|
|
function get_version {
|
|
local target_path=$1
|
|
if command -v "${target_path}" > /dev/null; then
|
|
echo "v$("${target_path}" --version | grep version: | awk '{print $2}')"
|
|
fi
|
|
}
|
|
|
|
REPO_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
|
|
|
SYSTEM_VERSION="$(get_version shellcheck)"
|
|
if [[ "${SYSTEM_VERSION}" == "${VERSION}" ]]; then
|
|
SHELLCHECK=shellcheck
|
|
else
|
|
# Try to install a local version
|
|
SHELLCHECK="${REPO_ROOT}/bin/shellcheck"
|
|
LOCAL_VERSION="$(get_version "${SHELLCHECK}")"
|
|
if [[ -z "${LOCAL_VERSION}" || "${LOCAL_VERSION}" != "${VERSION}" ]]; then
|
|
if which sw_vers &> /dev/null; then
|
|
echo "on macos, only x86_64 binaries are available so rosetta is required"
|
|
echo "to avoid using rosetta, install via homebrew: brew install shellcheck"
|
|
DIST=darwin.x86_64
|
|
else
|
|
# Linux - binaries for common arches *should* be available
|
|
arch="$(uname -i)"
|
|
DIST="linux.${arch}"
|
|
fi
|
|
curl -s -L "https://github.com/koalaman/shellcheck/releases/download/${VERSION}/shellcheck-${VERSION}.${DIST}.tar.xz" | tar Jxv -C /tmp > /dev/null
|
|
mkdir -p "$(dirname "${SHELLCHECK}")"
|
|
cp /tmp/shellcheck-"${VERSION}"/shellcheck "${SHELLCHECK}"
|
|
fi
|
|
fi
|
|
|
|
IGNORED_CONDITIONS=()
|
|
for file in ${IGNORED_FILES}; do
|
|
if [[ -n "${IGNORED_CONDITIONS-}" ]]; then
|
|
IGNORED_CONDITIONS+=(-o)
|
|
fi
|
|
IGNORED_CONDITIONS+=(-path "${REPO_ROOT}/${file}" -prune)
|
|
done
|
|
|
|
find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" "${@}"
|