Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/main ./cmd/goappmon"
entrypoint = ["./tmp/main"]
include_ext = ["go", "html", "sql", "json"]
exclude_dir = ["tmp", "vendor", ".git"]
exclude_regex = ["_test\\.go"]

[log]
time = true

[misc]
clean_on_exit = true
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Bug report
description: Report a reproducible problem or regression
title: "[Bug]: "
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug.
Please fill in as much detail as possible so the issue can be reproduced quickly.
- type: textarea
id: summary
attributes:
label: Summary
description: Describe the problem in one or two sentences.
placeholder: What happened?
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: List the exact steps that trigger the issue.
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
description: What actually happened?
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Share relevant runtime, OS, Go version, or deployment details.
placeholder: Go version, OS, package version, etc.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs or screenshots
description: Paste logs, stack traces, or screenshots if they help explain the problem.
render: shell
- type: checkboxes
id: confirmations
attributes:
label: Confirmations
options:
- label: I have searched existing issues and docs.
required: true
- label: I can reproduce this issue consistently.
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Project documentation
url: https://github.com/phyowaiyan-dev/goappmon/tree/develop/docs
about: Review the project docs before opening a new issue.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Feature request
description: Suggest an improvement or new capability
title: "[Feature]: "
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Thanks for sharing an idea.
Please describe the user problem and the outcome you want, not just the implementation.
- type: textarea
id: problem
attributes:
label: Problem statement
description: What user problem should this feature solve?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
description: Describe the solution you would like to see.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Share any other options you considered.
- type: textarea
id: context
attributes:
label: Additional context
description: Add screenshots, references, or related issues.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Question
description: Ask for help or clarification about the project
title: "[Question]: "
labels:
- question
body:
- type: markdown
attributes:
value: |
Use this template for support questions, usage clarification, or project guidance.
- type: textarea
id: question
attributes:
label: Your question
description: Ask your question clearly and include context.
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: Include code, config, or links that help explain the question.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches:
- develop
pull_request:
workflow_dispatch:

jobs:
fmt:
name: Go Format
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.1"
check-latest: true

- name: Verify gofmt
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "The following files need gofmt:"
gofmt -l .
exit 1
fi

lint:
name: GolangCI-Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.1"
check-latest: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.11.2
args: --timeout=5m

test:
name: Go Test
runs-on: ubuntu-latest
needs:
- fmt
- lint

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.1"
check-latest: true
cache: true

- name: Download modules
run: go mod download

- name: Run tests
run: go test ./...

- name: Build
run: go build ./...
40 changes: 40 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docs

on:
push:
paths:
- "README.md"
- "docs/**"
- ".github/workflows/docs.yml"
pull_request:
paths:
- "README.md"
- "docs/**"
- ".github/workflows/docs.yml"
workflow_dispatch:

jobs:
validate-docs:
name: Validate docs structure
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check required docs files exist
run: |
test -f README.md
test -f docs/README.md
test -f docs/project-overview.md
test -f docs/tech-stack.md
test -f docs/architecture.md
test -f docs/development.md
test -f docs/testing.md
test -f docs/release.md
test -f docs/security.md
test -f docs/contributing.md
test -f docs/roadmap.md

- name: Print docs tree
run: find docs -maxdepth 1 -type f | sort
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: Build ${{ matrix.os }} / ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}

strategy:
fail-fast: false
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-latest
artifact_name: goappmon-linux-amd64
archive_name: goappmon-linux-amd64.tar.gz
binary_name: goappmon
- os: linux
arch: arm64
runner: ubuntu-latest
artifact_name: goappmon-linux-arm64
archive_name: goappmon-linux-arm64.tar.gz
binary_name: goappmon
- os: darwin
arch: amd64
runner: macos-latest
artifact_name: goappmon-darwin-amd64
archive_name: goappmon-darwin-amd64.tar.gz
binary_name: goappmon
- os: darwin
arch: arm64
runner: macos-latest
artifact_name: goappmon-darwin-arm64
archive_name: goappmon-darwin-arm64.tar.gz
binary_name: goappmon
- os: windows
arch: amd64
runner: windows-latest
artifact_name: goappmon-windows-amd64
archive_name: goappmon-windows-amd64.zip
binary_name: goappmon.exe

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.1"
check-latest: true
cache: true

- name: Download modules
run: go mod download

- name: Build binary
shell: bash
run: |
set -euo pipefail
mkdir -p dist
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o "dist/${{ matrix.binary_name }}" ./cmd/goappmon

- name: Package Linux and macOS release
if: matrix.os != 'windows'
shell: bash
run: |
set -euo pipefail
tar -czf "dist/${{ matrix.archive_name }}" -C dist "${{ matrix.binary_name }}"

- name: Package Windows release
if: matrix.os == 'windows'
shell: pwsh
run: |
Compress-Archive -Path "dist/${{ matrix.binary_name }}" -DestinationPath "dist/${{ matrix.archive_name }}"

- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/${{ matrix.archive_name }}
if-no-files-found: error
retention-days: 14

publish:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs:
- build
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Download all release artifacts
uses: actions/download-artifact@v4
with:
path: release-assets

- name: Collect release files
shell: bash
run: |
set -euo pipefail
mkdir -p dist
find release-assets -type f | while read -r file; do
cp "$file" dist/
done
ls -lah dist

- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
Loading
Loading