Revert "CI: download shellcheck (MR 2142)"
It's back in Alpine edge.
This reverts commit 3987d2f764
.
This commit is contained in:
parent
8563efb9da
commit
672ebe797b
|
@ -22,7 +22,7 @@ static-code-analysis:
|
||||||
before_script:
|
before_script:
|
||||||
- .ci/prepare.sh
|
- .ci/prepare.sh
|
||||||
script:
|
script:
|
||||||
- DOWNLOAD_SHELLCHECK=1 su pmos -c "test/static_code_analysis.sh"
|
- su pmos -c "test/static_code_analysis.sh"
|
||||||
|
|
||||||
vermin:
|
vermin:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
|
|
@ -13,35 +13,22 @@ cd "$DIR/.."
|
||||||
# Install needed packages
|
# Install needed packages
|
||||||
echo "Initializing Alpine chroot (details: 'pmbootstrap log')"
|
echo "Initializing Alpine chroot (details: 'pmbootstrap log')"
|
||||||
./pmbootstrap.py -q chroot -- apk -q add \
|
./pmbootstrap.py -q chroot -- apk -q add \
|
||||||
|
shellcheck \
|
||||||
python3 \
|
python3 \
|
||||||
py3-flake8 || return 1
|
py3-flake8 || return 1
|
||||||
|
|
||||||
rootfs_native="$(./pmbootstrap.py config work)/chroot_native"
|
rootfs_native="$(./pmbootstrap.py config work)/chroot_native"
|
||||||
command="$rootfs_native/lib/ld-musl-$(uname -m).so.1"
|
command="$rootfs_native/lib/ld-musl-$(uname -m).so.1"
|
||||||
command="$command --library-path=$rootfs_native/lib:$rootfs_native/usr/lib"
|
command="$command --library-path=$rootfs_native/lib:$rootfs_native/usr/lib"
|
||||||
|
shellcheck_command="$command $rootfs_native/usr/bin/shellcheck"
|
||||||
flake8_command="$command $rootfs_native/usr/bin/python3 $rootfs_native/usr/bin/flake8"
|
flake8_command="$command $rootfs_native/usr/bin/python3 $rootfs_native/usr/bin/flake8"
|
||||||
|
|
||||||
# Shellcheck isn't in Alpine anymore, so just download the static binary in CI
|
|
||||||
# Related: https://gitlab.alpinelinux.org/alpine/aports/-/issues/10902
|
|
||||||
if [ "$DOWNLOAD_SHELLCHECK" = 1 ]; then
|
|
||||||
pkgver="0.7.2"
|
|
||||||
tmpdir="/tmp/shellcheck-$pkgver"
|
|
||||||
url="https://github.com/koalaman/shellcheck/releases/download/v$pkgver/shellcheck-v$pkgver.linux.x86_64.tar.xz"
|
|
||||||
mkdir -p "$tmpdir"
|
|
||||||
if ! [ -e "$tmpdir"/rel.tar.xz ]; then
|
|
||||||
echo "Downloading $url"
|
|
||||||
wget -q -O "$tmpdir"/rel.tar.xz "$url"
|
|
||||||
fi
|
|
||||||
tar -C "$tmpdir" -xf "$tmpdir"/rel.tar.xz
|
|
||||||
export PATH="$tmpdir/shellcheck-v$pkgver/:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Shell: shellcheck
|
# Shell: shellcheck
|
||||||
find . -name '*.sh' |
|
find . -name '*.sh' |
|
||||||
while read -r file; do
|
while read -r file; do
|
||||||
echo "Test with shellcheck: $file"
|
echo "Test with shellcheck: $file"
|
||||||
cd "$DIR/../$(dirname "$file")"
|
cd "$DIR/../$(dirname "$file")"
|
||||||
shellcheck -e SC1008 -x "$(basename "$file")"
|
$shellcheck_command -e SC1008 -x "$(basename "$file")"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Python: flake8
|
# Python: flake8
|
||||||
|
|
Loading…
Reference in New Issue