mirror of
https://github.com/coredns/coredns.git
synced 2025-11-18 09:52:17 -05:00
* Use major version pinning for actions to reduce dependeabot churn. * Use tilde matching for Go versions to use the latest patch release. * Checkout before installing Go to fix go module caching. Signed-off-by: SuperQ <superq@gmail.com>
31 lines
761 B
YAML
31 lines
761 B
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@v3
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '~1.20.0'
|
|
id: go
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test With Coverage
|
|
run: |
|
|
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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
|