Skip to content

Commit

Permalink
Working through linting and unit testing github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronromeo committed Jan 1, 2024
1 parent 37d10e6 commit fb9026d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
version: v1.54
args: --config .golangci.yml
working-directory: ./system/go-pyrfid-juke-support
# working-directory: ./system/go-pyrfid-juke-support

pre-commit:
name: Run pre-commit hooks
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/unittesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,28 @@ jobs:
with:
go-version: "~1.21" # Use the version of Go in your project

- name: Test with Go
run: go test -json > TestResults.json
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...

- name: Upload Go test results
uses: actions/upload-artifact@v3
- name: generate test coverage report
run: go tool cover -html=./cover.out -o ./cover.html

- name: upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: ./cover.html

- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
name: Go-results
path: TestResults.json
# Configure action using config file (option 1)
config: ./.testcoverage.yml

# Configure action by specifying input parameters individually (option 2).
# If you are using config file you shouldn't use these parameters.
profile: cover.out
local-prefix: https://github.com/aaronromeo/pyrfid-jukebox
threshold-file: 80
threshold-package: 80
threshold-total: 95

0 comments on commit fb9026d

Please sign in to comment.