Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 0 additions & 252 deletions .github/workflows/ci.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on:
pull_request:
branches:
- v2
push:
branches:
- v2
workflow_dispatch:

jobs:

runMakeTest:
name: Run 'make test'
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.17.x
uses: actions/setup-go@v3
with:
go-version: "1.17.x"
- run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Restore go mod cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: make test
run: make test
working-directory: ./src
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why set working-directory here? for the deps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source code and Makefile are currently in the src sub-directory.

8 changes: 5 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
KO = $(PROJECT_DIR)/bin/ko
ENVTEST = $(PROJECT_DIR)/bin/setup-envtest
GINKGO = $(PROJECT_DIR)/bin/ginkgo
TOOLCHAIN = \
$(CONTROLLER_GEN) \
$(KO) \
$(ENVTEST)
$(ENVTEST) \
$(GINKGO)
HELM_BASE_OPTS ?= --set serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn=${NTHV2_IAM_ROLE_ARN}
GINKGO_BASE_OPTS ?= --coverpkg $(shell head -n 1 $(PROJECT_DIR)/go.mod | cut -s -d ' ' -f 2)/pkg/...
KODATA = \
Expand Down Expand Up @@ -64,9 +66,9 @@ verify: ## Run go fmt and go vet against code.
go vet $(PROJECT_DIR)/...

.PHONY: test
test: ## Run tests.
test: $(GINKGO) ## Run tests.
go vet $(PROJECT_DIR)/...
ginkgo run $(GINKGO_BASE_OPTS) $(GINKGO_OPTS) $(PROJECT_DIR)/test/
$(GINKGO) run $(GINKGO_BASE_OPTS) $(GINKGO_OPTS) $(PROJECT_DIR)/test/

##@ Build

Expand Down
1 change: 1 addition & 0 deletions src/scripts/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tools=(
# setup-envtest version specifiers:
# https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest/versions?tab=versions
"sigs.k8s.io/controller-runtime/tools/[email protected]"
"github.com/onsi/ginkgo/v2/[email protected]"
)

bin_dir=""
Expand Down