Skip to content

Commit b6d18b8

Browse files
authored
Merge pull request #18 from sapcc/init-go-makefile-maker
2 parents 4c2a15d + 548a079 commit b6d18b8

34 files changed

+987
-352
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: SAP SE or an SAP affiliate company
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
root = true
5+
6+
[*]
7+
insert_final_newline = true
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
indent_style = space
11+
indent_size = 2
12+
13+
[{Makefile,go.mod,go.sum,*.go}]
14+
indent_style = tab
15+
indent_size = unset
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[{LICENSE,LICENSES/*,vendor/**}]
21+
charset = unset
22+
end_of_line = unset
23+
indent_size = unset
24+
indent_style = unset
25+
insert_final_newline = unset
26+
trim_trailing_whitespace = unset

.envrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: 2019–2020 Target
3+
# SPDX-FileCopyrightText: 2021 The Nix Community
4+
# SPDX-License-Identifier: Apache-2.0
5+
if type -P lorri &>/dev/null; then
6+
eval "$(lorri direnv)"
7+
elif type -P nix &>/dev/null; then
8+
use nix
9+
else
10+
echo "Found no nix binary. Skipping activating nix-shell..."
11+
fi

.github/renovate.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"default:pinDigestsDisabled",
6+
"mergeConfidence:all-badges",
7+
"docker:disable"
8+
],
9+
"assignees": [
10+
"SchwarzM",
11+
"Nuckal777",
12+
"goerangudat",
13+
"defo89"
14+
],
15+
"commitMessageAction": "Renovate: Update",
16+
"constraints": {
17+
"go": "1.24"
18+
},
19+
"dependencyDashboardOSVVulnerabilitySummary": "all",
20+
"osvVulnerabilityAlerts": true,
21+
"postUpdateOptions": [
22+
"gomodTidy",
23+
"gomodUpdateImportPaths"
24+
],
25+
"packageRules": [
26+
{
27+
"matchPackageNames": [
28+
"golang"
29+
],
30+
"allowedVersions": "1.24.x"
31+
},
32+
{
33+
"matchPackageNames": [
34+
"/^github\\.com\\/sapcc\\/.*/"
35+
],
36+
"automerge": true,
37+
"groupName": "github.com/sapcc"
38+
},
39+
{
40+
"matchPackageNames": [
41+
"!/^github\\.com\\/sapcc\\/.*/",
42+
"/.*/"
43+
],
44+
"matchUpdateTypes": [
45+
"minor",
46+
"patch"
47+
],
48+
"groupName": "External dependencies"
49+
},
50+
{
51+
"matchPackageNames": [
52+
"/^k8s.io\\//"
53+
],
54+
"allowedVersions": "0.28.x"
55+
}
56+
],
57+
"prHourlyLimit": 0,
58+
"schedule": [
59+
"before 8am on Friday"
60+
],
61+
"semanticCommits": "disabled"
62+
}

.github/workflows/checks.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
################################################################################
2+
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
3+
# Edit Makefile.maker.yaml instead. #
4+
################################################################################
5+
6+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
name: Checks
10+
"on":
11+
push:
12+
branches:
13+
- main
14+
pull_request:
15+
branches:
16+
- '*'
17+
workflow_dispatch: {}
18+
permissions:
19+
checks: write
20+
contents: read
21+
jobs:
22+
checks:
23+
name: Checks
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check out code
27+
uses: actions/checkout@v5
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
30+
with:
31+
check-latest: true
32+
go-version: 1.24.6
33+
- name: Run golangci-lint
34+
uses: golangci/golangci-lint-action@v8
35+
with:
36+
version: latest
37+
- name: Delete pre-installed shellcheck
38+
run: sudo rm -f $(which shellcheck)
39+
- name: Run shellcheck
40+
run: make run-shellcheck
41+
- name: Dependency Licenses Review
42+
run: make check-dependency-licenses
43+
- name: Check for spelling errors
44+
uses: reviewdog/action-misspell@v1
45+
with:
46+
exclude: ./vendor/*
47+
fail_on_error: true
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
ignore: importas
50+
reporter: github-check
51+
- name: Check if source code files have license header
52+
run: make check-addlicense
53+
- name: REUSE Compliance Check
54+
uses: fsfe/reuse-action@v5
55+
- name: Install govulncheck
56+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
57+
- name: Run govulncheck
58+
run: govulncheck -format text ./...

.github/workflows/ci.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
################################################################################
2+
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
3+
# Edit Makefile.maker.yaml instead. #
4+
################################################################################
5+
6+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
name: CI
10+
"on":
11+
push:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- '**.md'
16+
pull_request:
17+
branches:
18+
- '*'
19+
paths-ignore:
20+
- '**.md'
21+
workflow_dispatch: {}
22+
permissions:
23+
contents: read
24+
jobs:
25+
build:
26+
name: Build
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out code
30+
uses: actions/checkout@v5
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
check-latest: true
35+
go-version: 1.24.6
36+
- name: Build all binaries
37+
run: make build-all
38+
test:
39+
name: Test
40+
needs:
41+
- build
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Check out code
45+
uses: actions/checkout@v5
46+
- name: Set up Go
47+
uses: actions/setup-go@v5
48+
with:
49+
check-latest: true
50+
go-version: 1.24.6
51+
- name: Run tests and generate coverage report
52+
run: make build/cover.out

.github/workflows/codeql.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
################################################################################
2+
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
3+
# Edit Makefile.maker.yaml instead. #
4+
################################################################################
5+
6+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
name: CodeQL
10+
"on":
11+
push:
12+
branches:
13+
- main
14+
pull_request:
15+
branches:
16+
- main
17+
schedule:
18+
- cron: '00 07 * * 1'
19+
workflow_dispatch: {}
20+
permissions:
21+
actions: read
22+
contents: read
23+
security-events: write
24+
jobs:
25+
analyze:
26+
name: CodeQL
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Check out code
30+
uses: actions/checkout@v5
31+
- name: Set up Go
32+
uses: actions/setup-go@v5
33+
with:
34+
check-latest: true
35+
go-version: 1.24.6
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: go
40+
queries: security-extended
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@v3
43+
- name: Perform CodeQL Analysis
44+
uses: github/codeql-action/analyze@v3
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
################################################################################
2+
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
3+
# Edit Makefile.maker.yaml instead. #
4+
################################################################################
5+
6+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
name: Container Registry GHCR
10+
"on":
11+
push:
12+
branches:
13+
- main
14+
workflow_dispatch: {}
15+
permissions:
16+
contents: read
17+
packages: write
18+
jobs:
19+
build-and-push-image:
20+
name: Push container to ghcr.io
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v5
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
- name: Extract metadata (tags, labels) for Docker
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ghcr.io/${{ github.repository }}
36+
tags: |
37+
# https://github.com/docker/metadata-action#typeedge
38+
type=edge
39+
# https://github.com/docker/metadata-action#latest-tag
40+
type=raw,value=latest,enable={{is_default_branch}}
41+
# https://github.com/docker/metadata-action#typesemver
42+
type=semver,pattern={{raw}}
43+
type=semver,pattern=v{{major}}.{{minor}}
44+
type=semver,pattern=v{{major}}
45+
# https://github.com/docker/metadata-action#typesha
46+
type=sha,format=long
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v3
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
- name: Build and push Docker image
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: .
55+
labels: ${{ steps.meta.outputs.labels }}
56+
platforms: linux/amd64
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)