57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Push Validation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
tags-ignore:
|
|
- "*"
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
container: docker.io/catthehacker/ubuntu:act-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.1'
|
|
check-latest: true
|
|
cache: true
|
|
cache-dependency-path: go.sum
|
|
|
|
- name: Run full unit test suite with coverage
|
|
run: |
|
|
set -euo pipefail
|
|
go test -covermode=atomic -coverprofile=coverage.out ./...
|
|
go tool cover -func=coverage.out
|
|
|
|
- name: Recommend next release tag on main pushes
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if recommended_tag="$(go run ./cmd/vociferate --recommend --root . 2>release-recommendation.err)"; then
|
|
{
|
|
echo
|
|
echo '## Release Recommendation'
|
|
echo
|
|
echo "- Recommended next tag: \`${recommended_tag}\`"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
recommendation_error="$(tr '\n' ' ' < release-recommendation.err | sed 's/[[:space:]]\+/ /g' | sed 's/^ //; s/ $//')"
|
|
echo "::warning::${recommendation_error}"
|
|
{
|
|
echo
|
|
echo '## Release Recommendation'
|
|
echo
|
|
echo "- No recommended tag emitted: ${recommendation_error}"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|