Skip to content

Commit

Permalink
wired up basic app
Browse files Browse the repository at this point in the history
* added cobra cli
* added github workflows
* added taskfiles
* added docs
  • Loading branch information
retr0h committed Mar 14, 2024
1 parent 8ba56ae commit 936c9ac
Show file tree
Hide file tree
Showing 45 changed files with 34,339 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# codecov:
# require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "50...100"

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: false

ignore:
- "**/*_mock.go"
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: chore

- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: chore

- package-ecosystem: "gomod"
directory: "examples/go-client/"
schedule:
interval: "daily"
commit-message:
prefix: chore
30 changes: 30 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
test/unit:
- changed-files:
- any-glob-to-any-file: "**/*_test.go"

test/integration:
- changed-files:
- any-glob-to-any-file: "tests/*"
- any-glob-to-any-file: "tests/*/**"

kind/go:
- changed-files:
- any-glob-to-any-file: "**/*.go"

kind/yaml:
- changed-files:
- any-glob-to-any-file: "**/*.yaml"
- any-glob-to-any-file: "**/*.yml"

kind/docs:
- changed-files:
- any-glob-to-any-file: "docs/*"
- any-glob-to-any-file: "docs/*/**"

github/action:
- changed-files:
- any-glob-to-any-file: ".github/**/*.yml"

release:
- base-branch: 'main'
15 changes: 15 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Cleanup

on:
pull_request:
types: [closed]

jobs:
delete-branch:
runs-on: ubuntu-latest
steps:
- name: delete branch
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Conventional Commits
on:
pull_request:
branches: [ "main" ]
jobs:
build:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: webiny/action-conventional-commits@v1.3.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/depreview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
28 changes: 28 additions & 0 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Test Deploy to GitHub Pages

on:
pull_request:
branches:
- main

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint the website
run: task docs:fmt:check
- name: Test build website
run: task docs:build
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: ./docs/yarn.lock
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build website
run: task docs:build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docs/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com


29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Go

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@v5
with:
go-version: '1.21'
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: task test ARCH=amd64_v1 GOOS=linux
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
if: env.month != 'Oct'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for your first issue! 😊🕹️'
pr-message: 'Thank you for contributing to this project! 😊🕹️'
- uses: actions/first-interaction@v1
if: env.month == 'Oct'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for your first issue! Happy Hacktoberfest!!! 🎃👕🕹️'
pr-message: 'Thank you for contributing to this project. Happy Hacktoberfest!!! 🎃👕🕹️'
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: goreleaser
on:
push:
tags:
- "v*"

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
14 changes: 14 additions & 0 deletions .github/workflows/reportcard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Go Report Card

on:
push:
branches: [ "main" ]

jobs:
action_goreportcard:
runs-on: ubuntu-latest
name: A job to run go report card
steps:
- name: Go Report Card
uses: creekorful/goreportcard-action@v1.0
18 changes: 18 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cobertura.xml
cover.out
dist/
result.xml
.task/
30 changes: 30 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Refer to golangci-lint's example config file for more options and information:
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml

run:
timeout: 5m
modules-download-mode: readonly
skip-dirs:
- .asdf

linters:
enable:
- errcheck
- errname
- goimports
- govet
- prealloc
- predeclared
- revive
- staticcheck

linters-settings:
revive:
rules:
- name: package-comments
disabled: true

issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
Loading

0 comments on commit 936c9ac

Please sign in to comment.