changelog: add 1.5.1 entry (config fixes, debug, tests, CI) #68
This file contains hidden or 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: CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: | |
| # Run on all tags except for release tags (e.g. v1.2.3) | |
| - '!v[0-9]+.[0-9]+.[0-9]+' | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Cache Go modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| - name: Install tools | |
| run: | | |
| go install github.com/golang-migrate/migrate/v4/cmd/migrate@latest | |
| - name: Check formatting | |
| run: | | |
| echo 'Checking gofmt...' | |
| UNFORMATTED=$(gofmt -s -l .) | |
| if [ -n "${UNFORMATTED}" ]; then | |
| echo "gofmt found unformatted files:" && echo "$UNFORMATTED" | |
| exit 1 | |
| fi | |
| - name: Static vet | |
| run: go vet ./... | |
| - name: Run tests (race, coverage) | |
| run: | | |
| go test ./... -v -race -coverprofile=coverage.out | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage | |
| path: coverage.out | |
| build: | |
| name: Build binary with version | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Compute version and git sha | |
| id: ver | |
| run: | | |
| echo "GITHUB_REF=${GITHUB_REF}" | |
| GIT_SHA=$(git rev-parse --short=8 HEAD) | |
| echo "git_sha=$GIT_SHA" >> $GITHUB_OUTPUT | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| # Version string: <tag> (sha) | |
| VERSION="$TAG ($GIT_SHA)" | |
| else | |
| VERSION="$GIT_SHA" | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build | |
| run: | | |
| echo "Building with version ${{ steps.ver.outputs.version }} (git ${GITHUB_SHA::8})" | |
| BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| go build -ldflags "-X main.version='${{ steps.ver.outputs.version }}' -X main.gitCommit='${{ steps.ver.outputs.git_sha }}' -X main.buildDate='${BUILD_DATE}'" -o keymaster ./cmd/keymaster | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: keymaster-${{ steps.ver.outputs.version }} | |
| path: keymaster |