Skip to content

Commit

Permalink
aesthetic cleanup with working ci cd setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pitabwire committed Dec 1, 2023
1 parent cd2a613 commit 87fe8f6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Service testing action

on: [push]

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout new code for testing
uses: actions/checkout@v4
- name: Setup go testing infrastructure
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Run all required system tests
run: make
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ repos:
- id: local-build
name: Locally build
description: A local make file to always build and test locally
entry: make build
entry: make
files: '\.go$'
language: 'system'
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ LICENSE_IGNORE := --ignore /testdata/
# Set to use a different compiler. For example, `GO=go1.18rc1 make test`.
GO ?= go

define clean_package
cd ${1} && go mod tidy
cd ${1} && go fmt ./...
cd ${1} && go vet ./...
endef
define build_package
cd ${1} && $(GO) mod tidy
cd ${1} && $(GO) fmt ./...
cd ${1} && $(GO) vet ./...
cd ${1} && $(GO) build ./...

endef

.PHONY: help
help: ## Describe useful make targets
Expand All @@ -35,20 +36,21 @@ clean: ## Delete intermediate build artifacts
@# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs
git clean -Xdf
$(call clean_package, .)
$(call clean_package, notification)
$(call clean_package, ocr)
$(call clean_package, partition)
$(call clean_package, profile)
$(call clean_package, property)
$(call clean_package, settings)


.PHONY: test
test: build ## Run unit tests
$(GO) test -vet=off -race -cover ./...

.PHONY: build
build: generate ## Build all packages
$(GO) build ./...
$(call build_package, notification)
$(call build_package, ocr)
$(call build_package, partition)
$(call build_package, profile)
$(call build_package, property)
$(call build_package, settings)


.PHONY: lint
lint: $(BIN)/golangci-lint $(BIN)/buf ## Lint Go and protobuf
Expand Down
8 changes: 4 additions & 4 deletions partition/v1/partition.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/partition/v1/partition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ message CreateAccessRoleRequest {
}

message CreateAccessRoleResponse {
AccessRoleObject Data = 1;
AccessRoleObject data = 1;
}

message AccessRoleObject {
Expand Down

0 comments on commit 87fe8f6

Please sign in to comment.