Skip to content

Commit 2b2ef5f

Browse files
committed
Enable shellcheck test - Use version 0.8.0 from easyrsa-unit-tests
Signed-off-by: Richard T Bonhomme <[email protected]>
1 parent 7510f61 commit 2b2ef5f

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

.github/workflows/action.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222

2323
env:
2424
EASYRSA_REMOTE_CI: 1
25+
EASYRSA_NIX: 1
2526
TERM: xterm-256color
2627

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

3233
# Runs a single command using the runners shell
33-
- name: shellcheck test
34-
run: shellcheck -V
35-
#run: shellcheck easyrsa3/easyrsa
3634
- name: operational test
3735
run: sh op_test.sh -v
3836

@@ -49,6 +47,7 @@ jobs:
4947

5048
env:
5149
EASYRSA_REMOTE_CI: 1
50+
EASYRSA_WIN: 1
5251
TERM: xterm-256color
5352

5453
# Steps represent a sequence of tasks that will be executed as part of the job

op_test.sh

+28-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
# and executes that - allows for disconnected testing from the easy-rsa
55
# repo with TravisCI.
66

7+
github_url='https://raw.githubusercontent.com'
8+
9+
if [ -e "shellcheck" ] && [ "$EASYRSA_NIX" ]; then
10+
chmod +x shellcheck
11+
./shellcheck -V
12+
./shellcheck easyrsa3/easyrsa
13+
elif [ "$EASYRSA_NIX" ]; then
14+
github_target='OpenVPN/easyrsa-unit-tests/master/shellcheck'
15+
curl -O "${github_url}/${github_target}"
16+
[ -e "shellcheck" ] || { echo "shellcheck download failed."; exit 9; }
17+
chmod +x shellcheck
18+
./shellcheck -V
19+
./shellcheck easyrsa3/easyrsa
20+
rm -f ./shellcheck
21+
fi
22+
723
case "$1" in
824
-v) verb='-v' ;;
925
-vv) verb='-vv' ;;
@@ -13,13 +29,20 @@ esac
1329
estat=0
1430

1531
if [ -e "easyrsa-unit-tests.sh" ]; then
16-
sh easyrsa-unit-tests.sh "$verb"
17-
estat=$?
32+
if sh easyrsa-unit-tests.sh "$verb"; then
33+
: # ok
34+
else
35+
estat=1
36+
fi
1837
else
19-
curl -O 'https://raw.githubusercontent.com/OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
38+
github_target='OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
39+
curl -O "${github_url}/${github_target}"
2040
[ -e "easyrsa-unit-tests.sh" ] || { echo "Unit-test download failed."; exit 9; }
21-
sh easyrsa-unit-tests.sh "$verb"
22-
estat=$?
41+
if sh easyrsa-unit-tests.sh "$verb"; then
42+
: # ok
43+
else
44+
estat=1
45+
fi
2346
rm -f easyrsa-unit-tests.sh
2447
fi
2548

0 commit comments

Comments
 (0)