diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 5e5d7a7..35e86fc 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -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 @@ -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 @@ -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 diff --git a/op_test.sh b/op_test.sh index 80f210d..00c3e41 100644 --- a/op_test.sh +++ b/op_test.sh @@ -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' ;; @@ -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