Skip to content

Commit 1833a81

Browse files
authored
Add code coverage (#14)
1 parent ba9adff commit 1833a81

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ jobs:
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v4
23+
2324
- name: Set up Go
2425
uses: actions/setup-go@v5
2526
with:
2627
go-version-file: 'go.mod'
28+
2729
- name: Run tests
2830
run: make test
31+
32+
- name: Upload results to Codecov
33+
uses: codecov/codecov-action@v4
34+
if: matrix.os == 'ubuntu-latest'
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
37+
2938
- name: Run build
3039
run: make build

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# don't track built binary
22
/tflint-ruleset-azurerm-security
33

4-
tools/
4+
tools/
5+
6+
7+
# test coverage
8+
cover.html
9+
cover.out
10+
coverage.txt

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default: build
22

33
test:
4-
go test ./...
4+
go test ./... -cover -coverprofile=coverage.txt
55

66
build:
77
go build

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# TFLint Ruleset AzureRm Security
22
[![build](https://github.com/pregress/tflint-ruleset-azurerm-securirty/actions/workflows/build.yml/badge.svg)](https://github.com/pregress/tflint-ruleset-azurerm-securirty/actions/workflows/build.yml)
3+
[![codecov](https://codecov.io/github/pregress/tflint-ruleset-azurerm-security/graph/badge.svg?token=J3ZJ051YQQ)](https://codecov.io/github/pregress/tflint-ruleset-azurerm-security)
34

45
This is a repository for an azurerm tflint rule set to enforce security best practices.
56

0 commit comments

Comments
 (0)