Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: David Bond <[email protected]>
  • Loading branch information
davidsbond committed Nov 29, 2021
0 parents commit c395929
Show file tree
Hide file tree
Showing 7,109 changed files with 1,839,643 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.github/
.golangci.yaml
docker-compose.yaml
vendor/
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/* linguist-vendored
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Version**
The version that produces the bug.

**To Reproduce**
Steps to reproduce the behaviour.

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add logs that describe the problem

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: daily
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
91 changes: 91 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Go
on:
push:
paths:
- '**.go'
jobs:
# Job that runs gofumports on all go source files. Will fail if any formatting changes
# have not been committed.
format:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: make go-install
- name: Format
run: make go-format
- name: Check for changes
run: make has-changes

# Job that runs golangci-lint on all go source files. Will fail on any linting
# errors.
lint:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: make go-install
- name: Lint
run: make go-lint

# Job that ensures all dependencies are added to the go.mod and go.sum files
mod:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tidy
run: make go-modules
- name: Check for changes
run: make has-changes

# Job that runs go tests.
test:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make go-test
75 changes: 75 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Proto
on:
push:
paths:
- 'proto/**'
jobs:
# Job that runs buf lint on all .proto files. Fails if any linting errors occur.
lint:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: make go-install
- name: Lint
run: make proto-lint

# Job that runs buf generate on all .proto files. Fails if any changes have not been
# committed.
generate:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: make go-install
- name: Generate
run: make proto-generate
- name: Check for changes
run: make has-changes

# Job that runs buf breaking against the master branch. Fails if any breaking changes are
# within the changeset.
breaking:
runs-on: ubuntu-latest
container: "golang:1.17"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up cache
uses: actions/cache@v2
with:
path: |
/go/pkg/mod
/root/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install tools
run: make go-install
- name: Check for breaking changes
env:
BUF_INPUT_HTTPS_USERNAME: ${{ github.repository_owner }}
BUF_INPUT_HTTPS_PASSWORD: ${{ github.token }}
run: make proto-breaking
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ github.token }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
.idea/
44 changes: 44 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
run:
timeout: 5m
tests: false
silent: true

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters:
disable:
- wsl
- gochecknoglobals
- lll
- funlen
- gochecknoinits
- sqlclosecheck
- dupl
- gci
- nlreturn
- bodyclose
- exhaustivestruct
- wrapcheck
- forbidigo
- cyclop
- maligned
- scopelint
- interfacer
- gomnd
- tagliatelle
- golint
- errname
- exhaustive
- ireturn
- varnamelen

issues:
exclude-use-default: false
exclude:
- G102
- G304
- G204
- SA1019
43 changes: 43 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
builds:
-
env:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }}"
goos:
- linux
goarch:
- amd64
binary: "{{ .ProjectName }}"

dockers:
- id: linux_amd64
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/davidsbond/kollect:{{ .Tag }}"
- "ghcr.io/davidsbond/kollect:latest"
dockerfile: Dockerfile
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"

archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256

release:
prerelease: auto

changelog:
use: github
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
COPY kollect /

ENTRYPOINT ["/kollect"]
Loading

0 comments on commit c395929

Please sign in to comment.