Add support for lists of tactics #4
Workflow file for this run
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
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "**/*.md" | ||
permissions: read | ||
Check failure on line 8 in .github/workflows/ci.yml GitHub Actions / .github/workflows/ci.ymlInvalid workflow file
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.14.0' | ||
- name: Setup GO environment | ||
run: | | ||
go mod download | ||
go get -u golang.org/x/lint/golint | ||
go get -t ./... | ||
- name: Lint | ||
run: | | ||
golint -set_exit_status ./... | ||
- name: Vet | ||
run: | | ||
go vet ./... | ||
- name: Unit tests | ||
run: | | ||
sudo go test ./... -coverprofile coverage.out -covermode count | ||
sudo go tool cover -func coverage.out | ||
- name: Quality Gate - Test coverage shall be above threshold | ||
env: | ||
TESTCOVERAGE_THRESHOLD: 40 | ||
run: | | ||
echo "Quality Gate: checking test coverage is above threshold ..." | ||
echo "Threshold : $TESTCOVERAGE_THRESHOLD %" | ||
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'` | ||
echo "Current test coverage : $totalCoverage %" | ||
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then | ||
echo "OK" | ||
else | ||
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value." | ||
echo "Failed" | ||
exit 1 | ||
fi | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
- name: Ensure build is functional | ||
run: go build ./... |