Skip to content

Commit

Permalink
Merge pull request #6 from d-dot-one/AWN-6.codecov-and-small-updates
Browse files Browse the repository at this point in the history
AWN-6 - Codecov and Some Tests
  • Loading branch information
d-dot-one committed Nov 30, 2023
2 parents 4f1c457 + 6978fad commit 5efa4da
Show file tree
Hide file tree
Showing 11 changed files with 701 additions and 310 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: code-coverage

on: [push]

jobs:
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
working-directory: .
shell: bash
env:
OS: ${{ matrix.os }}

steps:
- name: checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
fetch-depth: 2

- name: install go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '^1.21.0'

- name: install dependencies
run: go mod download

- name: build
run: go build ./...

- name: test
run: go test ./...

- name: coverage
run: go test -v -race -covermode=atomic -buildvcs -coverprofile=./artifacts/coverage.out ./...

- name: upload coverage reports
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
directory: ./artifacts
files: coverage.out
name: ${{ github.repository }}
verbose: true
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# OS
.DS_Store

# git
# Sensitive files
.gitconfig-awn
go.work
.envrc

# Binaries for programs and plugins
*.exe
Expand All @@ -13,17 +15,11 @@

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
testing.*

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace and environment
go.work
.envrc

# ide
.idea/
.idea/**
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ test:
## test/cover: run all tests and display coverage
.PHONY: cover
cover:
go test -v -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out
export GOCOVERDIR=./artifacts/
# go build -cover -o=./bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}
go test -v -race -covermode=atomic -buildvcs -coverprofile=./artifacts/coverage.out ./...
#go tool cover -html=./artifacts/coverage.out

## build: build the application
.PHONY: build
build:
go build -o=/tmp/bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}
go build -o=./bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}

## run: run the application
.PHONY: run
Expand Down
55 changes: 55 additions & 0 deletions artifacts/coverage.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
mode: atomic
github.com/d-dot-one/awn/client.go:100.46,102.16 2 0
github.com/d-dot-one/awn/client.go:102.16,104.3 1 0
github.com/d-dot-one/awn/client.go:105.2,105.12 1 0
github.com/d-dot-one/awn/client.go:105.12,107.3 1 0
github.com/d-dot-one/awn/client.go:108.2,108.18 1 0
github.com/d-dot-one/awn/client.go:113.39,115.2 1 0
github.com/d-dot-one/awn/client.go:125.50,129.9 3 0
github.com/d-dot-one/awn/client.go:129.9,131.3 1 0
github.com/d-dot-one/awn/client.go:133.2,136.32 3 0
github.com/d-dot-one/awn/client.go:147.47,157.42 1 0
github.com/d-dot-one/awn/client.go:157.42,161.5 1 0
github.com/d-dot-one/awn/client.go:163.2,165.20 2 0
github.com/d-dot-one/awn/client.go:176.60,182.2 4 1
github.com/d-dot-one/awn/client.go:194.84,208.52 7 0
github.com/d-dot-one/awn/client.go:208.52,210.3 1 0
github.com/d-dot-one/awn/client.go:212.2,212.25 1 0
github.com/d-dot-one/awn/client.go:226.92,250.52 7 0
github.com/d-dot-one/awn/client.go:250.52,252.3 1 0
github.com/d-dot-one/awn/client.go:254.2,254.25 1 0
github.com/d-dot-one/awn/client.go:265.98,268.79 2 0
github.com/d-dot-one/awn/client.go:268.79,275.3 4 0
github.com/d-dot-one/awn/client.go:277.2,277.28 1 0
github.com/d-dot-one/awn/client.go:290.71,291.16 1 3
github.com/d-dot-one/awn/client.go:291.16,292.16 1 0
github.com/d-dot-one/awn/client.go:293.16,294.34 1 0
github.com/d-dot-one/awn/client.go:295.16,296.34 1 0
github.com/d-dot-one/awn/client.go:297.18,298.36 1 0
github.com/d-dot-one/awn/client.go:299.15,300.36 1 0
github.com/d-dot-one/awn/client.go:301.16,302.36 1 0
github.com/d-dot-one/awn/client.go:305.2,305.12 1 3
github.com/d-dot-one/awn/client.go:315.58,317.8 2 0
github.com/d-dot-one/awn/client.go:317.8,318.18 1 0
github.com/d-dot-one/awn/client.go:319.25,321.34 2 0
github.com/d-dot-one/awn/client.go:322.33,324.34 2 0
github.com/d-dot-one/awn/client.go:325.23,327.38 2 0
github.com/d-dot-one/awn/client.go:328.29,330.38 2 0
github.com/d-dot-one/awn/client.go:331.11,332.21 1 0
github.com/d-dot-one/awn/client.go:336.2,336.18 1 0
github.com/d-dot-one/awn/client.go:350.56,355.12 3 0
github.com/d-dot-one/awn/client.go:355.12,358.80 2 0
github.com/d-dot-one/awn/client.go:358.80,365.4 4 0
github.com/d-dot-one/awn/client.go:368.2,368.17 1 0
github.com/d-dot-one/awn/client.go:377.50,380.22 2 1
github.com/d-dot-one/awn/client.go:380.22,383.3 2 2
github.com/d-dot-one/awn/client.go:385.2,385.16 1 1
github.com/d-dot-one/awn/client.go:394.52,396.13 2 4
github.com/d-dot-one/awn/client.go:396.13,398.3 1 2
github.com/d-dot-one/awn/client.go:400.2,400.14 1 4
github.com/d-dot-one/awn/data_structures.go:22.39,26.2 2 0
github.com/d-dot-one/awn/data_structures.go:29.54,37.2 1 0
github.com/d-dot-one/awn/data_structures.go:41.38,49.2 1 1
github.com/d-dot-one/awn/data_structures.go:90.45,94.2 2 0
github.com/d-dot-one/awn/data_structures.go:176.40,181.2 3 0
github.com/d-dot-one/awn/realtime_client.go:15.40,40.2 2 0
Loading

0 comments on commit 5efa4da

Please sign in to comment.