Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Add an action for CodeCov #71

Merged
merged 3 commits into from
Feb 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# GitHub Actions CI/CD to check packageless test coverage
name: coverage

# Run the action on push to main and pull requests
on: [push, pull_request, workflow_dispatch]

# Set up the actual workflow jobs
jobs:
test-coverage:
runs-on: ubuntu-latest

steps:
# Checkout the Repo for testing
- uses: actions/checkout@v2
# Get Docker setup
- uses: docker-practice/actions-setup-docker@master
with:
docker_version: "20.10"
docker_channel: stable
# Set up Go
- uses: actions/setup-go@v2
with:
go-version: 1.16.4

# Run the go tests
- name: Get subcommands package coverage
run: go test -short -race -covermode=atomic -coverprofile=subcommands_coverage.out ./subcommands

# Upload to CodeCov
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v2
with:
files: ./subcommands_coverage.out
flags: subcommands-coverage
name: codecov-umbrella
verbose: true