Skip to content

Commit 35df9c0

Browse files
committed
chore: 🚀 init repo
1 parent 0fe21cc commit 35df9c0

23 files changed

+3976
-1
lines changed

‎.devcontainer/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
4+
ARG VARIANT="jammy"
5+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install protobuf-compiler

‎.devcontainer/devcontainer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "zeiss/template-go",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
6+
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
7+
"args": {
8+
"VARIANT": "ubuntu-22.04"
9+
}
10+
},
11+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
12+
"postCreateCommand": "bash scripts/postCreateCommand.sh",
13+
"features": {
14+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
15+
"ghcr.io/devcontainers/features/go:1": {}
16+
},
17+
"customizations": {
18+
"vscode": {
19+
"extensions": [
20+
"GitHub.copilot",
21+
"GitHub.vscode-github-actions",
22+
"golang.go",
23+
"ms-vscode.makefile-tools"
24+
]
25+
}
26+
}
27+
}

‎.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false
16+
17+
[{Makefile,**.mk}]
18+
# Use tabs for indentation (Makefiles require tabs)
19+
indent_style = tab

‎.envrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
SCRIPT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "${BASH_SOURCE:-$0}"`
3+
4+
export PROJECT_DIR=$(dirname $SCRIPT)
5+
export GO111MODULE=on
6+
export DOCKER_HOST_IP=127.0.0.1
7+
export GOPROXY=direct
8+
export PATH=$PATH:$PWD/bin

‎.envsh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
SCRIPT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "${BASH_SOURCE:-$0}"`
3+
4+
export PROJECT_DIR=$(dirname $SCRIPT)
5+
export GO111MODULE=on
6+
export DOCKER_HOST_IP=127.0.0.1
7+
export GOPROXY=direct
8+
export PATH=$PATH:$PWD/bin

‎.gitattributes

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Automatically normalize line endings for all text-based files
2+
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3+
* text=auto
4+
5+
# For the following file types, normalize line endings to LF on
6+
# checkin and prevent conversion to CRLF when they are checked out
7+
# (this is required in order to prevent newline related issues like,
8+
# for example, after the build script is run)
9+
.* text eol=lf
10+
*.css text eol=lf
11+
*.html text eol=lf
12+
*.js text eol=lf
13+
*.json text eol=lf
14+
*.md text eol=lf
15+
*.sh text eol=lf
16+
*.txt text eol=lf
17+
*.xml text eol=lf

‎.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: gomod
14+
directory: "/tools"
15+
schedule:
16+
interval: daily
17+
time: "04:00"
18+
open-pull-requests-limit: 10

‎.github/workflows/automerge.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .github/workflows/automerge.yml
2+
3+
name: Dependabot (auto-merge)
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
dependabot:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.actor == 'dependabot[bot]' }}
18+
steps:
19+
- name: Enable auto-merge for Dependabot PRs
20+
run: gh pr merge --auto --merge "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/codeql.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# .github/workflows/codeql.yml
2+
3+
name: "CodeQL"
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
schedule:
11+
- cron: '43 0 * * 5'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'go' ]
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-go@v5
30+
with:
31+
go-version-file: go.mod
32+
- uses: github/codeql-action/init@v2
33+
with:
34+
languages: ${{ matrix.language }}
35+
- run: |
36+
make build
37+
- uses: github/codeql-action/analyze@v2
38+
with:
39+
category: "/language:${{matrix.language}}"

‎.github/workflows/main.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# .github/workflows/main.yml
2+
3+
name: Test & Build
4+
5+
on:
6+
workflow_call:
7+
push:
8+
branches:
9+
- main
10+
- release/*
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
checks: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: ./go.mod
25+
- run: make test
26+
- uses: dorny/test-reporter@v1
27+
if: success() || failure()
28+
with:
29+
name: Go Test Results
30+
path: .test/reports/**-test.xml
31+
reporter: java-junit
32+
fail-on-error: 'true'
33+
- uses: actions/upload-artifact@v3
34+
if: success() || failure()
35+
with:
36+
name: Test Reports
37+
path: .test/reports/**
38+
39+
lint:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-go@v5
44+
with:
45+
go-version-file: ./go.mod
46+
check-latest: true
47+
- run: make lint

‎.github/workflows/release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .github/workflows/release.yml
2+
3+
name: Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
test:
12+
permissions:
13+
checks: write
14+
uses: ./.github/workflows/main.yml
15+
16+
release:
17+
runs-on: ubuntu-latest
18+
needs: [ test ]
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: ./go.mod
26+
- uses: goreleaser/goreleaser-action@v5
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
29+
with:
30+
version: latest
31+
args: release
32+
if: success()

0 commit comments

Comments
 (0)