Skip to content
Merged

sdaf #243

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
128 changes: 12 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,31 @@
# github test

[![Build Image Release](https://github.com/spidernet-io/spiderpool/actions/workflows/build-release-image.yaml/badge.svg)](https://github.com/spidernet-io/spiderpool/actions/workflows/build-release-image.yaml)

[![Lint Go-lint checks](https://github.com/spidernet-io/spiderpool/actions/workflows/lint-golang.yaml/badge.svg)](https://github.com/spidernet-io/spiderpool/actions/workflows/lint-golang.yaml)

## requirement

secret.PAT

## ========== workflow ==================

## feature

### (1) go-lint for source code

### (2) codeql check

### (3) codeowners , who reivew PR

### (4) auto package base image

### (5) auto package release image by tag

### (6) CI build

build CI image for each PR or PUSH to main , to check your code is right ,

and then auto gc the image at intarval ( at now only image of orgs is supported , personal image failed)

the go pkg cache could accelerate the build ,

the cache is cleaned auto at interval , or by manual

### (7) build beta image by manual

### (8) issue manage

issue template , auto assign label and assignees

auto stale inactive issue after 60 and auto close stale issue after 14

### (8) PR manage

CODEOWNERS auto assign reviewer ( the one who should be the repo member and not me , then you can see it )

auto close stale PR after 60 and auto close stale issue after 14

label check. only when the pr labled with changelog-related label, the pr could be approved.
changelog-related label could be used to auto generating changelog when releasing

### (9) check chart under charts dierctory
## github workflow badge

### (10) auto generating changelog to /changelogs/***

when tag or dispatch by manual , auto generate changelog by the related-label history PR between tags,
then commit the pr to main branch , then auto approve it

### (11) pr label and auto changelog

#### all pr should label one of bellowing , so could be merged to changelog

pr/release/bug, pr/release/feature-new, pr/release/feature-changed,
pr/release/doc, pr/release/robot_changelog, pr/release/changelog,
pr/release/none-required

#### other label for pr

#### below label of pr will be the changelog

pr/release/bug for Fixes

pr/release/feature-new for New Features

pr/release/feature-changed for Changed Features

### (12) label syncer

### 13 auto add lable 'pr/approved,pr/need-release-label' to reviewed PR

we can get all issiue labeld with "pr/need-release-label"
and label them with release-related lables , and merge it

### 14 check license missing in go file

### 15 auto publish chart

### 16 use /docs of "webserver" branch as root page of github page and chart repo

the charts package located on /docs/charts and index.yaml located on /docs

helm repo add mytest <https://weizhoublue.github.io/github-action-test>

and also could visit <https://weizhoublue.github.io/github-action-test> for web doc

## ========== makefile ==================

### auto generate license of vendor

### auto globally modify go version in files

## ============================
[![Build Image Release](https://github.com/spidernet-io/spiderpool/actions/workflows/build-release-image.yaml/badge.svg)](https://github.com/spidernet-io/spiderpool/actions/workflows/build-release-image.yaml)

## manage flow
[![Lint Go-lint checks](https://github.com/spidernet-io/spiderpool/actions/workflows/lint-golang.yaml/badge.svg)](https://github.com/spidernet-io/spiderpool/actions/workflows/lint-golang.yaml)

### for issue

check these labeled with "issue/not-assign" , and assign them
## golang simple report

auto close stale one after 60 and auto close stale one after 14
this is from <https://goreportcard.com>

### for PR
[![Go Report Card](https://goreportcard.com/badge/github.com/weizhoublue/github-action-test)](https://goreportcard.com/report/github.com/weizhoublue/github-action-test)

2 reviewer approve , and auto label with "pr/approved" ,
## golang detailed quality

PR must be labeled with "pr/release/**" for merge , which used to generate changelog auto
this is from <https://www.codefactor.io>

auto close stale PR after 60 and auto close stale issue after 14
[![CodeFactor](https://www.codefactor.io/repository/github/weizhoublue/github-action-test/badge)](https://www.codefactor.io/repository/github/weizhoublue/github-action-test)

### for Release
## test coverage report

if push tag with v*.*.* ,
this is from <https://coveralls.io>

(1) auto trigger building release image
(2) auto commit changelog PR with label "pr/release/robot_changelog"
(3) auto commit chart PR with label "pr/release/robot_chart", to /docs/charts/* of "webserver" branch , and generate /docs/index.yaml , please set /docs of "webserver" branch as github page
(4) auto create the release
[![Coverage Status](https://coveralls.io/repos/github/weizhoublue/github-action-test/badge.svg?branch=main)](https://coveralls.io/github/weizhoublue/github-action-test?branch=main)

pr who labeled with following label, will exist in changelog of release:

label "pr/release/feature-new" will generate "New Features" category

label "pr/release/bug" will generate "Fixes" category

label "pr/release/feature-changed" will generate "Changed Features" category
37 changes: 37 additions & 0 deletions pkg/testdoc/example_test.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
// Copyright 2022 Authors of welan
// SPDX-License-Identifier: Apache-2.0

package testdoc_test

import (
"fmt"
"github.com/weizhoublue/github-action-test/pkg/testdoc"
)

// this will show in godoc as a example of function usage
// Example${functionName}
func ExampleTestBug() {
fmt.Printf("generate godoc showing how to call function TestBug() \n")
testdoc.TestBug()

}

// this will show in godoc as a example of datatype
// Example${dataType}
func ExampleTester() {
fmt.Printf("generate godoc showing how to use dataType \n")
t := testdoc.Tester{
Buf: []int{1, 2, 3},
R: 100,
}
t.Method()
}

// this will show in godoc as a example of datatype method
// Example${dataType}_{Methodname}
func ExampleTester_Method() {
fmt.Printf("generate godoc showing how to call method of sturct \n")
t := testdoc.Tester{
Buf: []int{1, 2, 3},
R: 100,
}
t.Method()
}
4 changes: 4 additions & 0 deletions pkg/testdoc/testdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ type Tester struct {
R int // this line will not show up
}

func (a *Tester) Method() {
fmt.Printf("Buf=%+v \n", a.Buf)
}

// Show do something ....
//
// this is description for Show
Expand Down