1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-01-08 04:03:58 +02:00
oauth2-proxy/test.sh
Shinebayar G dc7dbc5d28
ci: migrate to Github Actions, close #546 (#750)
* ci: migrate to Github Actions

* ci: optimize on feedback

* ci: run gocov in correct dir

* ci: running after-build script always

* ci: giving test script execute permission

* ci: correct error handling on test script

* ci: more verbose test script

* ci: configure CC_TEST_REPORTER_ID env

* ci: check existence of CC_TEST_REPORT_ID variable, skip if unset

* ci: check existence of CC_TEST_REPORT_ID variable, skip if unset

* update changelog

* Update CHANGELOG.md

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-10-05 10:29:47 +01:00

28 lines
633 B
Bash
Executable File

#!/bin/bash
# manually exiting from script, because after-build needs to run always
set +e
if [ -z $CC_TEST_REPORT_ID ]; then
echo "1. CC_TEST_REPORT_ID is unset, skipping"
else
echo "1. Running before-build"
./cc-test-reporter before-build
fi
echo "2. Running test"
make test
TEST_STATUS=$?
echo "TEST_STATUS: ${TEST_STATUS}"
if [ -z $CC_TEST_REPORT_ID ]; then
echo "3. CC_TEST_REPORT_ID is unset, skipping"
else
echo "3. Running after-build"
./cc-test-reporter after-build --exit-code $TEST_STATUS -t gocov
fi
if [ "$TEST_STATUS" -ne 0 ]; then
echo "Test failed, status code: $TEST_STATUS"
exit $TEST_STATUS
fi