Skip to content

Commit

Permalink
add: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Dec 23, 2023
1 parent 88fd77c commit 3896976
Show file tree
Hide file tree
Showing 34 changed files with 799 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: nao1215

21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG Report] XXX"
labels: bug
assignees: ''

---

## About the problem
A clear description of the bug encountered.

## Expected behavior
Expected behavior.

## Steps to reproduce
Steps to reproduce the bug.

## Environment
- OS: [e.g. Windows 10]
- Command Name & Version: [e.g. s3hub 0.1.0]
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "20:00"
groups:
aws-sdk:
patterns:
- github.com/aws/aws-sdk-go-v2
- github.com/aws/aws-sdk-go-v2/*
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"

- name: Build
run: make build
13 changes: 13 additions & 0 deletions .github/workflows/gitleak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: gitleaks
on: [pull_request]
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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: Download dependencies
run: go mod download

- uses: nao1215/actions-hottest@v1
with:
args: '-cover -coverpkg=./... -coverprofile=coverage.out ./...'
- uses: k1LoW/octocov-action@v0
31 changes: 31 additions & 0 deletions .github/workflows/mac_test.yml
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 ./...
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
19 changes: 19 additions & 0 deletions .github/workflows/security.yml
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: ./...
31 changes: 31 additions & 0 deletions .github/workflows/windows_test.yml
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 ./...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@

# Go workspace file
go.work
cover.*
data
56 changes: 56 additions & 0 deletions .golangci.yml
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
27 changes: 27 additions & 0 deletions .octocov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# generated by octocov init
coverage:
if: true
acceptable: 60%
badge:
path: docs/coverage.svg
testExecutionTime:
if: true
acceptable:
- 1:1.1
- current <= 1min && diff <= 2sec
badge:
path: docs/time.svg
diff:
datastores:
- artifact://${GITHUB_REPOSITORY}
comment:
if: is_pull_request
summary:
if: true
report:
if: is_default_branch
datastores:
- artifact://${GITHUB_REPOSITORY}
codeToTestRatio:
badge:
path: docs/ratio.svg
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## [](/compare/77bdf974281a...) (2023-12-23)

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.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Introduction
Thank you for considering contributing to the rainbow project. User feedback is a source of encouragement for me. This document outlines a few rules to ensure that users do not feel overwhelmed when contributing to the rainbow project.

If you have any questions, feel free to communicate.

## Typo Fixes
If you find a typo, please report it via an Issue or create a Pull Request. If the tests pass, it will be merged promptly.

## Bug Reporting/Fixing
If you encounter behavior that seems like a bug, please report it via an Issue. When creating a Pull Request, be sure to include unit tests that reproduce the bug.

## New Feature Proposals
We are always eager to hear fantastic ideas! Start by sharing your proposal in an Issue.

## GitHub Star
This is the easiest way to contribute! I enjoy seeing the GitHub Stars increase.

## GitHub Sponsors
If you wish to provide financial support, please do so through [GitHub Sponsors](https://github.com/sponsors/nao1215).
This project incurs costs on AWS, so even small contributions help cover expenses. Financial support is appreciated.
Loading

0 comments on commit 3896976

Please sign in to comment.