Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed May 11, 2024
1 parent 6f75675 commit da00d2c
Show file tree
Hide file tree
Showing 30 changed files with 1,582 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: nao1215
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Desktop (please complete the following information):**
- Go Version [e.g. 1.17]
- Library Version [e.g. 1.0.1]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Task
about: Describe this issue
title: ''
labels: ''
assignees: ''

---

## What

Describe what this issue should address.

## How

Describe how to address the issue.

13 changes: 13 additions & 0 deletions .github/dependabot.yml
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"
31 changes: 31 additions & 0 deletions .github/workflows/coverge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Coverage

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@v5
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@v1
36 changes: 36 additions & 0 deletions .github/workflows/multi_platform_ut.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: MultiPlatformUnitTest

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
unit_test:
name: Unit test (linux)

strategy:
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"
go:
- "1"
- "1.22"
- "1.21"
- "1.20"
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Run tests with coverage report output
run: go test -cover -coverpkg=./... -coverprofile=coverage.out ./...
41 changes: 41 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

# Go workspace file
go.work
coverage.*
48 changes: 48 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
run:
go: "1.21"

issues:
exclude-use-default: false

linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- asciicheck
- bodyclose
- dogsled
- durationcheck
- errorlint
- exhaustive
- exportloopref
- forcetypeassert
- gochecknoinits
- goconst
- gocritic
- goimports
- gosec
- misspell
- nakedret
- noctx
- prealloc
- rowserrcheck
- sqlclosecheck
- stylecheck
- tagliatelle
- thelper
- unconvert
- unparam
- wastedassign
- whitespace
linters-settings:
tagliatelle:
case:
use-field-name: true
rules:
json: snake
16 changes: 16 additions & 0 deletions .octocov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# generated by octocov init
coverage:
if: true
acceptable: 80%
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
comment:
if: is_pull_request
hideFooterLink: false
summary:
if: true
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please approach others with respect. That is everything.
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.PHONY: build test clean help tools changelog

APP = csv
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) coverage.out coverage.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}'

changelog: ## Generate changelog
ghch --format markdown > CHANGELOG.md

tools: ## Install dependency tools
$(GO_INSTALL) github.com/Songmu/ghch/cmd/ghch@latest
Loading

0 comments on commit da00d2c

Please sign in to comment.