mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: Go Coverage
|
|
on: [pull_request]
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Setup Go Version
|
|
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
id: go
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test With Coverage
|
|
run: |
|
|
go install github.com/fatih/faillint@c56e3ec6dbfc933bbeb884fd31f2bcd41f712657 # v1.15.0
|
|
for d in request core coremain plugin test; do \
|
|
( cd $d; go test -coverprofile=cover.out -covermode=atomic -race ./...; [ -f cover.out ] && cat cover.out >> ../coverage.txt ); \
|
|
done
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
|