You've already forked dcmerge
							
							chore(ci): add golang tests
This commit is contained in:
		
							
								
								
									
										23
									
								
								.gitea/workflows/golang-tests.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								.gitea/workflows/golang-tests.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | name: Golang Tests | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   pull_request: | ||||||
|  |     types: [ "opened", "reopened", "synchronize" ] | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |     - '**' | ||||||
|  |     tags-ignore: | ||||||
|  |     - '**' | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   unittest: | ||||||
|  |     runs-on: | ||||||
|  |     - ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |     - uses: actions/checkout@v4.2.2 | ||||||
|  |     - uses: actions/setup-go@v5.4.0 | ||||||
|  |       with: | ||||||
|  |         go-version: stable | ||||||
|  |     - env: | ||||||
|  |         GOPROXY: ${{ vars.GOPROXY }} | ||||||
|  |       run: make test/unit | ||||||
							
								
								
									
										10
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
									
									
									
									
								
							| @@ -26,11 +26,7 @@ DCMERGE_IMAGE_UNQUALIFIED=${DCMERGE_IMAGE_NAMESPACE}/${DCMERGE_IMAGE_NAME}:${DCM | |||||||
| # ============================================================================== | # ============================================================================== | ||||||
| dcmerge: | dcmerge: | ||||||
| 	CGO_ENABLED=0 \ | 	CGO_ENABLED=0 \ | ||||||
| 	GOPRIVATE=$(shell go env GOPRIVATE) \ |  | ||||||
| 	GOPROXY=$(shell go env GOPROXY) \ | 	GOPROXY=$(shell go env GOPROXY) \ | ||||||
| 	GONOPROXY=$(shell go env GONOPROXY) \ |  | ||||||
| 	GONOSUMDB=$(shell go env GONOSUMDB) \ |  | ||||||
| 	GOSUMDB=$(shell go env GOSUMDB) \ |  | ||||||
| 		go build -ldflags "-X 'main.version=${VERSION}'" -o ${@} main.go | 		go build -ldflags "-X 'main.version=${VERSION}'" -o ${@} main.go | ||||||
|  |  | ||||||
| # CLEAN | # CLEAN | ||||||
| @@ -43,14 +39,20 @@ clean: | |||||||
| # ============================================================================== | # ============================================================================== | ||||||
| PHONY+=test/unit | PHONY+=test/unit | ||||||
| test/unit: | test/unit: | ||||||
|  | 	CGO_ENABLED=0 \ | ||||||
|  | 	GOPROXY=$(shell go env GOPROXY) \ | ||||||
| 		go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./pkg/... | 		go test -v -p 1 -coverprofile=coverage.txt -covermode=count -timeout 1200s ./pkg/... | ||||||
|  |  | ||||||
| PHONY+=test/integration | PHONY+=test/integration | ||||||
| test/integration: | test/integration: | ||||||
|  | 	CGO_ENABLED=0 \ | ||||||
|  | 	GOPROXY=$(shell go env GOPROXY) \ | ||||||
| 		go test -v -p 1 -count=1 -timeout 1200s ./it/... | 		go test -v -p 1 -count=1 -timeout 1200s ./it/... | ||||||
|  |  | ||||||
| PHONY+=test/coverage | PHONY+=test/coverage | ||||||
| test/coverage: test/unit | test/coverage: test/unit | ||||||
|  | 	CGO_ENABLED=0 \ | ||||||
|  | 	GOPROXY=$(shell go env GOPROXY) \ | ||||||
| 		go tool cover -html=coverage.txt | 		go tool cover -html=coverage.txt | ||||||
|  |  | ||||||
| # GOLANGCI-LINT | # GOLANGCI-LINT | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user