Skip to content

Commit

Permalink
test: run test & build in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ankithans authored and wtrocki committed Jul 1, 2021
1 parent c5891ca commit ca6b5ce
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/go_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches: [main]
paths:
- '**.go'
- "**.go"
pull_request:
branches: [main]
paths:
- '**.go'
- "**.go"

jobs:
build:
Expand All @@ -28,3 +28,5 @@ jobs:
# args: --issues-exit-code=0
- name: Build
run: make build
- name: Test Validator Example
run: make test/validator
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
# Dependency directories (remove the comment below to include it)
# vendor/

/host
/host
validator_example
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ run:
go run ./examples/host

build:
go build ./examples/host
go build -o host_example ./examples/host
go build -o validator_example ./validator/example

test:
test/validator:
go test ./validator/example
11 changes: 10 additions & 1 deletion validator/example/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package example
package main

import (
"log"

"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -58,3 +60,10 @@ func NewCommand() *cobra.Command {

return cmd
}

func main() {
cmd := NewCommand()
if err := cmd.Execute(); err != nil {
log.Fatal(err)
}
}
2 changes: 1 addition & 1 deletion validator/example/cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package example
package main

import (
"testing"
Expand Down

0 comments on commit ca6b5ce

Please sign in to comment.