Enable shellcheck test - Use version 0.8.0 from easyrsa-unit-tests
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
7510f6163c
commit
2b2ef5f7b8
5
.github/workflows/action.yml
vendored
5
.github/workflows/action.yml
vendored
@ -22,6 +22,7 @@ jobs:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
EASYRSA_REMOTE_CI: 1
|
EASYRSA_REMOTE_CI: 1
|
||||||
|
EASYRSA_NIX: 1
|
||||||
TERM: xterm-256color
|
TERM: xterm-256color
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
@ -30,9 +31,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Runs a single command using the runners shell
|
# Runs a single command using the runners shell
|
||||||
- name: shellcheck test
|
|
||||||
run: shellcheck -V
|
|
||||||
#run: shellcheck easyrsa3/easyrsa
|
|
||||||
- name: operational test
|
- name: operational test
|
||||||
run: sh op_test.sh -v
|
run: sh op_test.sh -v
|
||||||
|
|
||||||
@ -49,6 +47,7 @@ jobs:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
EASYRSA_REMOTE_CI: 1
|
EASYRSA_REMOTE_CI: 1
|
||||||
|
EASYRSA_WIN: 1
|
||||||
TERM: xterm-256color
|
TERM: xterm-256color
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
|
|||||||
33
op_test.sh
33
op_test.sh
@ -4,6 +4,22 @@
|
|||||||
# and executes that - allows for disconnected testing from the easy-rsa
|
# and executes that - allows for disconnected testing from the easy-rsa
|
||||||
# repo with TravisCI.
|
# repo with TravisCI.
|
||||||
|
|
||||||
|
github_url='https://raw.githubusercontent.com'
|
||||||
|
|
||||||
|
if [ -e "shellcheck" ] && [ "$EASYRSA_NIX" ]; then
|
||||||
|
chmod +x shellcheck
|
||||||
|
./shellcheck -V
|
||||||
|
./shellcheck easyrsa3/easyrsa
|
||||||
|
elif [ "$EASYRSA_NIX" ]; then
|
||||||
|
github_target='OpenVPN/easyrsa-unit-tests/master/shellcheck'
|
||||||
|
curl -O "${github_url}/${github_target}"
|
||||||
|
[ -e "shellcheck" ] || { echo "shellcheck download failed."; exit 9; }
|
||||||
|
chmod +x shellcheck
|
||||||
|
./shellcheck -V
|
||||||
|
./shellcheck easyrsa3/easyrsa
|
||||||
|
rm -f ./shellcheck
|
||||||
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-v) verb='-v' ;;
|
-v) verb='-v' ;;
|
||||||
-vv) verb='-vv' ;;
|
-vv) verb='-vv' ;;
|
||||||
@ -13,13 +29,20 @@ esac
|
|||||||
estat=0
|
estat=0
|
||||||
|
|
||||||
if [ -e "easyrsa-unit-tests.sh" ]; then
|
if [ -e "easyrsa-unit-tests.sh" ]; then
|
||||||
sh easyrsa-unit-tests.sh "$verb"
|
if sh easyrsa-unit-tests.sh "$verb"; then
|
||||||
estat=$?
|
: # ok
|
||||||
|
else
|
||||||
|
estat=1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
curl -O 'https://raw.githubusercontent.com/OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
|
github_target='OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
|
||||||
|
curl -O "${github_url}/${github_target}"
|
||||||
[ -e "easyrsa-unit-tests.sh" ] || { echo "Unit-test download failed."; exit 9; }
|
[ -e "easyrsa-unit-tests.sh" ] || { echo "Unit-test download failed."; exit 9; }
|
||||||
sh easyrsa-unit-tests.sh "$verb"
|
if sh easyrsa-unit-tests.sh "$verb"; then
|
||||||
estat=$?
|
: # ok
|
||||||
|
else
|
||||||
|
estat=1
|
||||||
|
fi
|
||||||
rm -f easyrsa-unit-tests.sh
|
rm -f easyrsa-unit-tests.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user