Dockerfile.receiver (CGO-free, /data volume), receiver image in CI and tag releases, receiver binary in release archives, make build-receiver, example k8s manifests (deployment/service/ingress/secret/pvc) under deploy/k8s/receiver/, and README coverage including sender/receiver token pairing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
80 lines
2.3 KiB
YAML
80 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: true
|
|
|
|
- name: Vet
|
|
run: GOTOOLCHAIN=local go vet ./...
|
|
|
|
- name: Test
|
|
run: GOTOOLCHAIN=local go test -v -race -coverprofile=coverage.out ./...
|
|
|
|
- name: Coverage report
|
|
run: GOTOOLCHAIN=local go tool cover -func=coverage.out
|
|
|
|
- name: Check internal package coverage
|
|
run: |
|
|
COVERAGE=$(GOTOOLCHAIN=local go tool cover -func=coverage.out | grep "^gitea.hansenits.com.au/hits/ExploreDNS/internal" | awk '{print $3}' | sed 's/%//' | awk '{sum+=$1; count++} END {if(count>0) print sum/count; else print 0}')
|
|
echo "Average internal package coverage: ${COVERAGE}%"
|
|
|
|
- name: Build
|
|
run: GOTOOLCHAIN=local go build -v ./...
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.hansenits.com.au
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push CLI image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.cli
|
|
push: true
|
|
tags: |
|
|
gitea.hansenits.com.au/hits/exploredns-cli:latest
|
|
gitea.hansenits.com.au/hits/exploredns-cli:${{ github.sha }}
|
|
|
|
- name: Build and push web image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.web
|
|
push: true
|
|
tags: |
|
|
gitea.hansenits.com.au/hits/exploredns-web:latest
|
|
gitea.hansenits.com.au/hits/exploredns-web:${{ github.sha }}
|
|
|
|
- name: Build and push receiver image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: Dockerfile.receiver
|
|
push: true
|
|
tags: |
|
|
gitea.hansenits.com.au/hits/exploredns-receiver:latest
|
|
gitea.hansenits.com.au/hits/exploredns-receiver:${{ github.sha }}
|