Skip to content

Commit

Permalink
ci: add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vwhitteron committed Feb 27, 2024
1 parent 2b7faa1 commit 2960870
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ jobs:
- name: Audit code
run: |
make audit
test:
name: Test
needs: qualitycheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Run tests
run: make test
- name: Generate coverage report
run: make test/cover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: vwhitteron/gt-telemetry
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# MacOS hidden files
.DS_Store

# Build files
examples/bin/

# Coverage reports
*.out
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ test:
## test/cover: run all tests and display coverage
.PHONY: test/cover
test/cover:
go test -v -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out
go test -v -race -buildvcs -coverprofile=coverage.out ./...

## test/cover/show: run all tests and display coverage in a browser
.PHONY: test/cover/show
test/cover/show: test/cover
go tool cover -html=coverage.out

## kaitai: compile the GT telemetry package from the Kaitai Struct
.PHONY: build/kaitai
Expand Down Expand Up @@ -106,4 +110,5 @@ run/live:
.PHONY: clean
clean:
@go clean
@rm -rf examples/bin
@rm -rf examples/bin
@rm -f coverage.out

0 comments on commit 2960870

Please sign in to comment.