Skip to content

Commit fca534b

Browse files
committed
Run tests using GitHub Actions
Signed-off-by: Richard Wall <[email protected]>
1 parent 97f857b commit fca534b

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/workflows/test.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: test
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request: {}
6+
jobs:
7+
fake-tpp:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-go@v3
12+
with:
13+
go-version-file: go.mod
14+
cache: true
15+
- run: make fake_tpp_test

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ tpp_test: get
6363
go test -v $(GOFLAGS) -coverprofile=cov_tpp.out ./pkg/venafi/tpp
6464
go tool cover -func=cov_tpp.out
6565

66+
fake_tpp_test: export MAKE := $(MAKE)
67+
fake_tpp_test:
68+
go test ./test/tpp/fake/...
69+
6670
cloud_test: get
6771
go test -v $(GOFLAGS) -coverprofile=cov_vaas.out ./pkg/venafi/cloud
6872
go tool cover -func=cov_vaas.out

test/tpp/fake/fake_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestFake(t *testing.T) {
3434
s.Start(ctx)
3535
t.Cleanup(func() { s.Close(ctx) })
3636

37-
cmd := exec.CommandContext(ctx, "make", "tpp_test")
37+
cmd := exec.CommandContext(ctx, os.Getenv("MAKE"), "tpp_test")
3838
cmd.Dir = "../../.."
3939
cmd.Env = append(
4040
os.Environ(),

0 commit comments

Comments
 (0)