Skip to content

Commit

Permalink
Init (#1)
Browse files Browse the repository at this point in the history
* init echo-prometheus

* build badges
  • Loading branch information
matoszz authored Aug 27, 2024
1 parent f983b79 commit 79d7f25
Show file tree
Hide file tree
Showing 23 changed files with 2,259 additions and 3 deletions.
69 changes: 69 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
env:
APP_NAME: ${BUILDKITE_PIPELINE_SLUG}
IMAGE_REPO: ghcr.io/theopenlane/${APP_NAME}
SONAR_HOST: "https://sonarcloud.io"
steps:
- group: ":test_tube: Tests"
key: "tests"
steps:
- label: ":golangci-lint: lint :lint-roller:"
key: "lint"
plugins:
- docker#v5.11.0:
image: "registry.hub.docker.com/golangci/golangci-lint:latest-alpine"
cancel_on_build_failing: true
command: ["golangci-lint", "run", "-v"]
always-pull: true
environment:
- "GOTOOLCHAIN=auto"
- label: ":golang: go test"
key: "go_test"
plugins:
- docker#v5.11.0:
image: golang:1.23.0
command: ["go", "test", "-coverprofile=coverage.out", "./..."]
artifact_paths: ["coverage.out"]
- group: ":closed_lock_with_key: Security Checks"
depends_on: "tests"
key: "security"
steps:
- label: ":closed_lock_with_key: gosec"
key: "gosec"
plugins:
- docker#v5.11.0:
image: "registry.hub.docker.com/securego/gosec:2.20.0"
command: ["-no-fail", "-exclude-generated", "-fmt sonarqube", "-out", "results.txt", "./..."]
environment:
- "GOTOOLCHAIN=auto"
artifact_paths: ["results.txt"]
- label: ":github: upload PR reports"
key: "scan-upload-pr"
if: build.pull_request.id != null
depends_on: ["gosec", "go_test"]
plugins:
- artifacts#v1.9.4:
download: "results.txt"
- artifacts#v1.9.4:
download: "coverage.out"
step: "go_test"
- docker#v5.11.0:
image: "sonarsource/sonar-scanner-cli:5"
environment:
- "SONAR_TOKEN"
- "SONAR_HOST_URL=$SONAR_HOST"
- "SONAR_SCANNER_OPTS=-Dsonar.pullrequest.branch=$BUILDKITE_BRANCH -Dsonar.pullrequest.base=$BUILDKITE_PULL_REQUEST_BASE_BRANCH -Dsonar.pullrequest.key=$BUILDKITE_PULL_REQUEST"
- label: ":github: upload reports"
key: "scan-upload"
if: build.branch == "main"
depends_on: ["gosec", "go_test"]
plugins:
- artifacts#v1.9.4:
download: results.txt
- artifacts#v1.9.4:
download: coverage.out
step: "go_test"
- docker#v5.11.0:
image: "sonarsource/sonar-scanner-cli:5"
environment:
- "SONAR_TOKEN"
- "SONAR_HOST_URL=$SONAR_HOST"
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @theopenlane/blacksmiths
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
labels: bug
assignees: ''

---

**Describe the bug or issue you're encountering**


**What are the relevant steps to reproduce, including the version(s) of the relevant software?**


**What is the expected behavior?**
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request]"
labels: enhancement
assignees: matoszz

---

**Describe how the feature might make your life easier or solve a problem**

**Describe the solution you'd like to see with any relevant context**

**Describe any alternatives you've considered or if there are short-tern vs. long-term options**
15 changes: 15 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Add 'bug' label to any PR where the head branch name starts with `bug` or has a `bug` section in the name
bug:
- head-branch: ["^bug", "bug"]
# Add 'enhancement' label to any PR where the head branch name starts with `enhancement` or has a `enhancement` section in the name
enhancement:
- head-branch: ["^enhancement", "enhancement", "^feature", "feature", "^enhance", "enhance", "^feat", "feat"]
# Add 'breaking-change' label to any PR where the head branch name starts with `breaking-change` or has a `breaking-change` section in the name
breaking-change:
- head-branch: ["^breaking-change", "breaking-change"]
ci:
- changed-files:
- any-glob-to-any-file: .github/**
- any-glob-to-any-file: .buildkite/**


24 changes: 24 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
changelog:
exclude:
labels:
- ignore-for-release
authors: []
categories:
- title: Breaking Changes 🛠
labels:
- Semver-Major
- breaking-change
- title: New Features 🎉
labels:
- Semver-Minor
- enhancement
- feature
- title: Bug Fixes 🐛
labels:
- bug
- title: 👒 Dependencies
labels:
- dependencies
- title: Other Changes
labels:
- "*"
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yaml
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
with:
sync-labels: true
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
*.exe
*.exe~
*.dll
*.so
*.dylib

*.test

*.out

go.work

*.db
server.crt
server.key
private_key.pem
public_key.pem

*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar

*.log

.vscode

.DS_Store*
.AppleDouble
.LSOverride
ehthumbs.db
Icon?
Thumbs.db

*.mime
*.mim

*.env
*.env-dev
*.config.yaml
43 changes: 43 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
run:
timeout: 10m
allow-serial-runners: true
concurrency: 0
linters-settings:
goimports:
local-prefixes: github.com/theopenlane/echo-prometheus
gofumpt:
extra-rules: true
gosec:
exclude-generated: true
revive:
ignore-generated-header: true
linters:
enable:
- bodyclose
- errcheck
- gocritic
- gocyclo
- err113
- gofmt
- goimports
- mnd
- gosimple
- govet
- gosec
- ineffassign
- misspell
- noctx
- revive
- staticcheck
- stylecheck
- typecheck
- unused
- whitespace
- wsl
issues:
fix: true
exclude-use-default: true
exclude-dirs:
- .buildkite/*
- .github/*
- templates/*
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default_stages: [pre-commit]
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: detect-private-key
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
- repo: https://github.com/crate-ci/typos
rev: v1.24.1
hooks:
- id: typos
20 changes: 20 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[files]
extend-exclude = ["go.mod","go.sum"]
ignore-hidden = true
ignore-files = true
ignore-dot = true
ignore-vcs = true
ignore-global = true
ignore-parent = true

[default]
binary = false
check-filename = true
check-file = true
unicode = true
ignore-hex = true
identifier-leading-digits = false
locale = "en"
extend-ignore-identifiers-re = []
extend-ignore-words-re = ["(?i)requestor","(?i)indentity","(?i)encrypter","(?i)seeked","(?i)generater"]
extend-ignore-re = ["#\\s*spellchecker:off\\s*\\n.*\\n\\s*#\\s*spellchecker:on"]
4 changes: 4 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exclude:
- config/
formatter:
retain_line_breaks: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright [2024] [The Open Lane, Inc.]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 79d7f25

Please sign in to comment.