Skip to content

Commit

Permalink
Enable shellcheck test - Use version 0.8.0 from easyrsa-unit-tests
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Mar 29, 2022
1 parent 7510f61 commit 2b2ef5f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:

env:
EASYRSA_REMOTE_CI: 1
EASYRSA_NIX: 1
TERM: xterm-256color

# Steps represent a sequence of tasks that will be executed as part of the job
Expand All @@ -30,9 +31,6 @@ jobs:
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: shellcheck test
run: shellcheck -V
#run: shellcheck easyrsa3/easyrsa
- name: operational test
run: sh op_test.sh -v

Expand All @@ -49,6 +47,7 @@ jobs:

env:
EASYRSA_REMOTE_CI: 1
EASYRSA_WIN: 1
TERM: xterm-256color

# Steps represent a sequence of tasks that will be executed as part of the job
Expand Down
33 changes: 28 additions & 5 deletions op_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
# and executes that - allows for disconnected testing from the easy-rsa
# 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
-v) verb='-v' ;;
-vv) verb='-vv' ;;
Expand All @@ -13,13 +29,20 @@ esac
estat=0

if [ -e "easyrsa-unit-tests.sh" ]; then
sh easyrsa-unit-tests.sh "$verb"
estat=$?
if sh easyrsa-unit-tests.sh "$verb"; then
: # ok
else
estat=1
fi
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; }
sh easyrsa-unit-tests.sh "$verb"
estat=$?
if sh easyrsa-unit-tests.sh "$verb"; then
: # ok
else
estat=1
fi
rm -f easyrsa-unit-tests.sh
fi

Expand Down

1 comment on commit 2b2ef5f

@TinCanTech
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.