This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from everettraven/actions/code_coverage
Add an action for CodeCov
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |