Skip to content

Commit 3171fa0

Browse files
authored
Merge pull request #1 from lablabs/feat/init-repo
feat: init repo
2 parents 18bd75a + 26860c3 commit 3171fa0

59 files changed

Lines changed: 4564 additions & 25 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore everything by default and re-include only needed files
3+
**
4+
5+
# Re-include Go source files (but not *_test.go)
6+
!**/*.go
7+
**/*_test.go
8+
9+
# Re-include Go module files
10+
!go.mod
11+
!go.sum

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
MISE_VERSION: 2025.12.13
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23+
24+
- name: Setup Mise
25+
uses: jdx/mise-action@9dc7d5dd454262207dea3ab5a06a3df6afc8ff26 # v3.4.1
26+
with:
27+
version: ${{ env.MISE_VERSION }}
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # 5.6.0
31+
with:
32+
go-version-file: go.mod
33+
34+
- name: Install dependencies
35+
run: mise download-deps
36+
37+
- name: Run golangci-lint
38+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # 9.2.0

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Release images/helm chart
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
env:
14+
HELM_VERSION: 3.14.0
15+
MISE_VERSION: 2025.12.13
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
helm:
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
27+
28+
- name: Setup Mise
29+
uses: jdx/mise-action@9dc7d5dd454262207dea3ab5a06a3df6afc8ff26 # v3.4.1
30+
with:
31+
version: ${{ env.MISE_VERSION }}
32+
33+
- name: Install Helm
34+
run: mise install helm
35+
36+
- name: Configure Git
37+
run: |
38+
git config user.name "$GITHUB_ACTOR"
39+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
40+
41+
- name: Extract version
42+
id: version
43+
run: |
44+
RAW_VERSION="${GITHUB_REF_NAME}"
45+
echo "VERSION=$RAW_VERSION" >> $GITHUB_OUTPUT
46+
47+
- name: Login to GitHub Container Registry
48+
run: |
49+
helm registry login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Package Helm chart
52+
run: |
53+
helm package charts/pod-deletion-cost-controller \
54+
--version ${{ steps.version.outputs.VERSION }} \
55+
--app-version ${{ steps.version.outputs.VERSION }}
56+
57+
- name: Push Helm chart to OCI registry
58+
run: |
59+
CHART_FILE=$(ls pod-deletion-cost-controller-*.tgz)
60+
helm push "$CHART_FILE" oci://ghcr.io/${{ github.repository }}
61+
62+
image:
63+
runs-on: ubuntu-24.04
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
67+
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # 3.7.0
70+
71+
- name: Set up Docker Buildx
72+
id: buildx
73+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # 3.12.0
74+
75+
- name: Login to Github Packages
76+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # 3.6.0
77+
with:
78+
registry: ghcr.io
79+
username: ${{ github.repository_owner }}
80+
password: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- name: Docker meta for tag
83+
id: meta-tag
84+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # 5.10.0
85+
with:
86+
images: ghcr.io/${{ github.repository }}
87+
flavor: |
88+
latest=true
89+
tags: |
90+
type=ref,event=tag
91+
92+
- name: Build image and push to GitHub Container Registry
93+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # 6.18.0
94+
id: docker_build
95+
with:
96+
context: .
97+
file: ./Dockerfile
98+
platforms: linux/amd64,linux/arm64
99+
tags: ${{ steps.meta-tag.outputs.tags }}
100+
labels: ${{ steps.meta-tag.outputs.labels }}
101+
annotations: ${{ steps.meta-tag.outputs.annotations }}
102+
cache-from: type=gha
103+
cache-to: type=gha,mode=max
104+
push: true

.github/workflows/renovate.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Renovate
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: 0 4 * * *
7+
8+
permissions:
9+
contents: write
10+
issues: read
11+
pull-requests: write
12+
13+
jobs:
14+
renovate:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
19+
with:
20+
persist-credentials: false
21+
22+
- name: Renovate
23+
uses: renovatebot/github-action@66387ab8c2464d575b933fa44e9e5a86b2822809 # v44.2.4
24+
env:
25+
RENOVATE_REPOSITORIES: ${{ github.repository }}
26+
RENOVATE_ONBOARDING: false
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-e2e.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: E2E/Integration Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
MISE_VERSION: 2025.12.13
16+
17+
jobs:
18+
test-e2e:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23+
24+
- name: Setup Mise
25+
uses: jdx/mise-action@9dc7d5dd454262207dea3ab5a06a3df6afc8ff26 # v3.4.1
26+
with:
27+
version: ${{ env.MISE_VERSION }}
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # 5.6.0
31+
with:
32+
go-version-file: go.mod
33+
34+
- name: Install kind
35+
run: mise install kind
36+
37+
- name: Running Test e2e in kind
38+
run: mise test-e2e

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
MISE_VERSION: 2025.12.13
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
23+
24+
- name: Setup Mise
25+
uses: jdx/mise-action@9dc7d5dd454262207dea3ab5a06a3df6afc8ff26 # v3.4.1
26+
with:
27+
version: ${{ env.MISE_VERSION }}
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # 5.6.0
31+
with:
32+
go-version-file: go.mod
33+
34+
- name: Running Test
35+
run: mise test

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.dll
88
*.so
99
*.dylib
10+
bin/
1011

1112
# Test binary, built with `go test -c`
1213
*.test
@@ -28,5 +29,11 @@ go.work.sum
2829
.env
2930

3031
# Editor/IDE
31-
# .idea/
32-
# .vscode/
32+
.idea/
33+
.vscode/
34+
35+
36+
# For testing on k3s cluster
37+
.k3s/
38+
39+
*.tgz

.gitlint

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[general]
2+
# enable Conventional‑Commit style rules
3+
contrib = contrib-title-conventional-commits
4+
ignore=body-is-missing
5+
6+
[T1] # title max-length
7+
line-length = 72

.golangci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "2"
2+
run:
3+
tests: false
4+
linters:
5+
enable:
6+
- revive
7+
- govet
8+
- staticcheck
9+
- errcheck
10+
- ineffassign
11+
exclusions:
12+
rules:
13+
- linters:
14+
- revive
15+
path: (.+)_test\.go
16+
- linters:
17+
- revive
18+
path: ^test/
19+
- linters:
20+
- revive
21+
text: "package-comments: should have a package comment"
22+
23+
issues:
24+
max-issues-per-linter: 0
25+
max-same-issues: 0

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: destroyed-symlinks
9+
- id: detect-private-key
10+
- id: check-ast
11+
- id: check-case-conflict
12+
- id: debug-statements
13+
14+
- repo: https://github.com/jorisroovers/gitlint
15+
rev: v0.19.1
16+
hooks:
17+
- id: gitlint
18+
stages: [commit-msg]
19+
20+
- repo: https://github.com/golangci/golangci-lint
21+
rev: v2.6.2
22+
hooks:
23+
- id: golangci-lint
24+
pass_filenames: false
25+
additional_dependencies: [] # MUST be here or Go env is empty
26+
args:
27+
- --timeout=5m
28+
- ./...
29+
require_serial: true

0 commit comments

Comments
 (0)