-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from go-spectest/first-pr
First PR
- Loading branch information
Showing
15 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Describe the bug | ||
A clear and concise description of what the bug is. | ||
|
||
## Steps to reproduce | ||
Clear instructions so we can reproduce the bug. | ||
|
||
## Expected behavior | ||
A clear and concise description of what you expected to happen. | ||
|
||
## Additional context | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Is your feature request related to a problem? | ||
A clear and concise description of what the problem is. E.g. I'm always frustrated when ... | ||
|
||
## Describe the solution you'd like | ||
A clear and concise description of what you want to happen. | ||
|
||
## Describe alternatives you've considered | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
## Additional context | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "20:00" | ||
open-pull-requests-limit: 10 | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Gosec | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v4 | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: --exclude-dir=examples --exclude-dir=aws ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: LinuxUnitTest | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
unit_test: | ||
name: Unit test (linux) | ||
|
||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1" | ||
check-latest: true | ||
|
||
- name: Run tests with coverage report output | ||
run: go test -cover -coverpkg=./... -coverprofile=coverage.out ./... | ||
- uses: k1LoW/octocov-action@v0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: MacUnitTest | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
unit_test: | ||
name: Unit test (mac) | ||
|
||
strategy: | ||
matrix: | ||
platform: [macos-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1" | ||
check-latest: true | ||
|
||
- name: Run unit test | ||
run: | | ||
go mod download | ||
go test -race -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: MultiVersionUnitTest | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: ["1.18", "1.21"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: MultiVersionUnitTest | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: reviewdog | ||
on: [pull_request] | ||
|
||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
reporter: github-pr-review | ||
level: warning | ||
golangci_lint_flags: --timeout=5m | ||
|
||
misspell: | ||
name: misspell | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: misspell | ||
uses: reviewdog/action-misspell@v1 | ||
with: | ||
reporter: github-pr-review | ||
level: warning | ||
locale: "US" | ||
|
||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: reviewdog/action-actionlint@v1 | ||
with: | ||
reporter: github-pr-review | ||
level: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: WindowsUnitTest | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
unit_test: | ||
name: Unit test (windows) | ||
|
||
strategy: | ||
matrix: | ||
platform: [windows-latest] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1" | ||
check-latest: true | ||
|
||
- name: Run unit test | ||
run: | | ||
go mod download | ||
go test -race -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
|
||
# Go workspace file | ||
go.work | ||
coverage.* | ||
naraku |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
run: | ||
go: "1.20" | ||
|
||
issues: | ||
exclude-use-default: false | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unused | ||
- varcheck | ||
- asciicheck | ||
- bodyclose | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forcetypeassert | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- goconst | ||
- gocritic | ||
- goimports | ||
- gomnd | ||
- gosec | ||
- ifshort | ||
- misspell | ||
- nakedret | ||
- noctx | ||
- paralleltest | ||
- prealloc | ||
- rowserrcheck | ||
- sqlclosecheck | ||
- stylecheck | ||
- tagliatelle | ||
- thelper | ||
- unconvert | ||
- unparam | ||
- wastedassign | ||
- whitespace | ||
linters-settings: | ||
tagliatelle: | ||
case: | ||
use-field-name: true | ||
rules: | ||
json: snake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# generated by octocov init | ||
coverage: | ||
if: true | ||
acceptable: 60% | ||
testExecutionTime: | ||
if: true | ||
acceptable: 1:1.1 | ||
acceptable: current <= 1min && diff <= 2sec | ||
diff: | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} | ||
comment: | ||
if: is_pull_request | ||
summary: | ||
if: true | ||
report: | ||
if: is_default_branch | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} | ||
coverage: | ||
badge: | ||
path: docs/coverage.svg | ||
codeToTestRatio: | ||
badge: | ||
path: docs/ratio.svg | ||
testExecutionTime: | ||
badge: | ||
path: docs/time.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.PHONY: build test clean | ||
|
||
APP = markdown | ||
VERSION = $(shell git describe --tags --abbrev=0) | ||
GIT_REVISION := $(shell git rev-parse HEAD) | ||
GO = go | ||
GO_BUILD = $(GO) build | ||
GO_TEST = $(GO) test -v | ||
GO_TOOL = $(GO) tool | ||
GOOS = "" | ||
GOARCH = "" | ||
GO_PKGROOT = ./... | ||
GO_PACKAGES = $(shell $(GO_LIST) $(GO_PKGROOT)) | ||
GO_LDFLAGS = | ||
|
||
clean: ## Clean project | ||
-rm -rf $(APP) cover.out cover.html | ||
|
||
test: ## Start unit test for server | ||
env GOOS=$(GOOS) $(GO_TEST) -cover -coverpkg=$(GO_PKGROOT) -coverprofile=coverage.out $(GO_PKGROOT) | ||
$(GO_TOOL) cover -html=coverage.out -o coverage.html | ||
|
||
.DEFAULT_GOAL := help | ||
help: ## Show help message | ||
@grep -E '^[0-9a-zA-Z_-]+[[:blank:]]*:.*?## .*$$' $(MAKEFILE_LIST) | sort \ | ||
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[1;32m%-15s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/go-spectest/markdown | ||
|
||
go 1.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package markdown is markdown builder that includes to convert Markdown to HTML. | ||
package markdown |