Skip to content

Commit

Permalink
first version
Browse files Browse the repository at this point in the history
  • Loading branch information
Eun committed Jan 15, 2024
0 parents commit 6b06caf
Show file tree
Hide file tree
Showing 28 changed files with 1,934 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [Eun] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: Eun # Replace with a single Liberapay username
issuehunt: eun # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description

## Problem
A short description of the problem this PR is addressing.

## Solution
A short description of the chosen method to resolve the problem
with an overview of the logic and implementation details when needed.

## Notes
Other notes that you want to share but do not fit into _Problem_ or _Solution_.

28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: "gomod"
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
time: "04:00"
commit-message:
prefix: "chore"
labels:
- "dependencies"
- "go"
- "chore"

- package-ecosystem: "github-actions"
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
time: "04:00"
commit-message:
prefix: "chore"
labels:
- "dependencies"
- "github_actions"
- "chore"

8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
labels:
'feature':
- '^(?i:feat)'
- '^(?i:feature)'
'fix':
- '^(?i:fix)'
'chore':
- '^(?i:chore)'
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
label: 'feature'
- title: '🐛 Bug Fixes'
label: 'fix'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
autolabeler:
- label: 'feature'
title:
- '/^feat/i'
- '/^feature/i'
- label: 'fix'
title:
- '/^fix/i'
- label: 'chore'
title:
- '/^chore/i'
template: |
## Changes
$CHANGES
17 changes: 17 additions & 0 deletions .github/workflows/pull_request_target_opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# this workflow will run on all pull requests opened but in the context of the base of the pull request.
on:
pull_request_target:
types: [opened]

name: "pull_request_target_opened"
jobs:
# labeler will label pull requests based on their title.
# the configuration is at .github/labeler.yml.
label_pull_request:
runs-on: ubuntu-latest
steps:
-
name: Label Pull Request
uses: jimschubert/labeler-action@v2
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
99 changes: 99 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# this workflow will run on all pushes.
on:
push:

name: "push"
jobs:
# run golangci-lint to lint the golang source code.
# the configuration is at /.golangci.yml.
linter:
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/[email protected]
-
name: Get go.mod details
uses: Eun/[email protected]
id: go-mod-details
-
name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ steps.go-mod-details.outputs.go_version }}
-
name: Lint
uses: golangci/[email protected]
with:
version: v1.55.2
# optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# use nancy to scan for vulnerabilities.
vulnerability_scanner:
name: Vulnerability scanner
runs-on: ubuntu-latest
steps:
-
uses: actions/[email protected]
-
uses: actions/setup-go@v5
# we cannot use nancy-github-action because it is outdated, so it's better to use the latest
# docker image for the validation
-
name: nancy
run: go list -json -m all | docker run -i sonatypecommunity/nancy:latest

# run golang test suite and collect their coverage.
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
-
name: Checkout code
uses: actions/[email protected]
-
name: Get go.mod details
uses: Eun/[email protected]
id: go-mod-details
-
name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ steps.go-mod-details.outputs.go_version }}
-
name: Test
run: go test -v -count=1 -coverprofile="coverage-${{ matrix.platform }}-${{ steps.go-mod-details.outputs.go_version }}.cov" -covermode=atomic ./...
-
name: Send coverage
uses: shogo82148/[email protected]
with:
path-to-profile: coverage-${{ matrix.platform }}-${{ steps.go-mod-details.outputs.go_version }}.cov
flag-name: ${{ matrix.platform }}-${{ steps.go-mod-details.outputs.go_version }}
parallel: true

# notifies that all test jobs are finished.
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/[email protected]
with:
parallel-finished: true

# draft your next release notes as pull requests are merged into "master"
# the configuration is at /.github/release-drafter.yml.
update_release_draft:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: release-drafter/release-drafter@v5
if: github.ref_name == github.event.repository.default_branch
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
Loading

0 comments on commit 6b06caf

Please sign in to comment.