Capture run time of plugins; Allow overriding default log values via … #179
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: [ v1 ] | |
pull_request: | |
branches: [ v1 ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Static analysis of code for errors | |
env: | |
PM_LOG_DIR: ${{ github.workspace }}/test-logs | |
run: | | |
mkdir -p ${{ github.workspace }}/test-logs | |
make analyze | |
# - name: Build | |
# run: go build -v ./... | |
- name: Build | |
run: make build | |
- name: Test - go test | |
env: | |
PM_CONF_FILE: ${{ github.workspace }}/sample/pm.config.yaml | |
PM_LOG_DIR: ${{ github.workspace }}/test-logs | |
INTEGRATION_TEST: START | |
INTEG_TEST_BIN: ${{ github.workspace }} | |
run: | | |
mkdir -p ${{ github.workspace }}/cover | |
mkdir -p ${{ github.workspace }}/test-logs | |
go test -mod=vendor -v ./... | |
# - name: Test - make test | |
# env: | |
# TOP: ${{ github.workspace }} | |
# GOSRC: ${{ github.workspace }} | |
# GOCOVER: ${{ github.workspace }}/cover | |
# GOTOOLSBIN: ${{ github.workspace }}/tools/go | |
# run: make test | |
# - name: Test - contents of make test! | |
# run: | | |
# set -x | |
# echo "Running Plugin Manager Go Unit Tests..."; | |
# GOSRC=${{ github.workspace }} | |
# GOCOVER=${{ github.workspace }}/cover | |
# TOOLSBIN=${{ github.workspace }}/tools | |
# GOTOOLSBIN=${{ github.workspace }}/tools/go | |
# mkdir -p ${GOCOVER}; | |
# export INTEG_TEST_BIN=${GOSRC}; | |
# mkdir -p ${INTEG_TEST_BIN}; | |
# export PM_CONF_FILE=${GOSRC}/sample/pm.config.yaml; | |
# export INTEGRATION_TEST=START; | |
# cd ${GOSRC}; | |
# test_failed=0; | |
# d=pm; | |
# go test -mod=vendor -v --cover -covermode=count -coverprofile=${GOCOVER}/${d}.out ./... | ${GOTOOLSBIN}/go-junit-report > TEST-${d}.xml; | |
# ret=${PIPESTATUS[0]}; | |
# if [ ${ret} -ne 0 ]; then | |
# echo "Go unit test failed for ${d}."; | |
# test_failed=1; | |
# fi ; | |
# cat TEST-${d}.xml | |
# awk -f ${TOOLSBIN}/gocoverage-collate.awk ${GOCOVER}/* > ${GOCOVER}/cover.out; | |
# go tool cover -html=${GOCOVER}/cover.out -o go-coverage-${d}.html; | |
# ${GOTOOLSBIN}/gocov convert ${GOCOVER}/cover.out | ${GOTOOLSBIN}/gocov-xml > go-coverage-${d}.xml; | |
# rm -rf ${GOCOVER}/*; | |
# export INTEGRATION_TEST=DONE; | |
# if [ ${test_failed} -ne 0 ]; then | |
# echo "Go unit tests failed."; | |
# exit 1; | |
# fi |