Skip to content

gha: move set-e lower. #38

gha: move set-e lower.

gha: move set-e lower. #38

Workflow file for this run

name: build app
on:
push:
branches-ignore:
- main
- master
tags:
- 'v*'
jobs:
test-code:
runs-on: ubuntu-latest
steps:
- name: "Install dependencies"
run: |-
sudo apt -y update && sudo apt -y install pandoc gettext
- uses: actions/checkout@v4
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: "Build app"
env:
GOFLAGS: -p=2
run: |-
go build -v ./...
- name: "Run tests"
env:
TEST_NAME: "Unit Tests"
run: |-
set +e
set -o pipefail
go test ./... 2>&1 | tee test-results.txt
S=$? #non-0 means error
if [ $S -eq 0 ]; then
R="Test(s) Passed: ${TEST_NAME}"
echo "::notice::$R"
R=":white_check_mark: $R"
else
R="Test(s) '${TEST_NAME}' failed"
echo "::error::$R"
R=":x: $R"
fi
set -e
echo "### ${R}" >> $GITHUB_STEP_SUMMARY
echo '---' >> $GITHUB_STEP_SUMMARY
echo '```shell' >> $GITHUB_STEP_SUMMARY
cat test-results.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: "tag branch"
uses: ./.github/workflows/util-tag-branch.yml