Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Build context for example/Dockerfile is the repo root. Keep it lean.
.git
.github
.idea
.vscode
.claude
.claude-global
docs
test
tmp
coverage.out
*.md
.golangci.yaml
.goreleaser.yaml
.lefthook.yaml
.mise.toml
.mise.local.toml
.editorconfig
Makefile
example/Dockerfile
example/.dockerignore
example/README.md
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@

<!-- Link related issues: Fixes #123, Closes #456 -->

## Changes
### Changes

<!-- List key changes -->

-

### Checklist

- [ ] My code adheres to the coding and style guidelines of the project.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented on my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation.

#### Notes
### Notes

<!-- Optional: Add additional context -->
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish docs

on:
push:
tags:
- v*.*.*
workflow_dispatch:

permissions:
pages: write
contents: write
id-token: write

jobs:
docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6

- uses: oven-sh/setup-bun@v2

- name: Install dependencies
working-directory: docs
run: bun install --frozen-lockfile

- name: Build docs
working-directory: docs
run: bun run build

- uses: actions/configure-pages@v6

- uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
31 changes: 0 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: pages
Expand All @@ -35,32 +33,3 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs:
needs: release
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6

- uses: oven-sh/setup-bun@v2

- name: Install dependencies
working-directory: docs
run: bun install --frozen-lockfile

- name: Build docs
working-directory: docs
run: bun run build

- uses: actions/configure-pages@v6

- uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,42 @@ jobs:
- name: Run test
run: make test

kind:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v6

- uses: jdx/mise-action@v4

- uses: actions/setup-go@v6
with:
check-latest: true
go-version-file: 'go.mod'

- name: Build example image
run: docker build -f example/Dockerfile -t foomo-gateway-example:test .

- name: Create kind cluster
uses: helm/kind-action@v1
with:
cluster_name: foomo-gateway
config: test/kind/kind-config.yaml

- name: Load image into kind
run: kind load docker-image foomo-gateway-example:test --name=foomo-gateway

- name: Apply CRD + manifests
run: |
kubectl apply -f config/crd/foomo.org_gateways.yaml
kubectl wait --for=condition=Established crd/gateways.foomo.org --timeout=30s
kubectl apply -f test/kind/manifests/
kubectl -n default wait --for=condition=Available --timeout=120s \
deployment/contentserver deployment/pagefrontend \
deployment/newsfrontend deployment/errorfrontend

- name: Run kind tests
env:
GO_TEST_TAGS: integration
run: go test -C test/kind -tags=safe -count=1 ./...
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@
## Lefthook
!.lefthook.yaml

## Docker
!.dockerignore

## VSCode
!.vscode/
.vscode/*
!.vscode/extensions.json
!.vscode/settings.default.json

## Golang
go.work
go.work.sum
!.golangci.yml
!.goreleaser.yml
/sandbox
/example/example
!.golangci.yaml
!.goreleaser.yaml

## Mise
!.mise.toml
Expand Down
15 changes: 12 additions & 3 deletions .golangci.yml β†’ .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ linters:
default: all
disable:
# Project specific linters
#- wsl_v5
- paralleltest
# Discouraged linters
- noinlineerr # Disallows inline error handling (`if err := ...; err != nil {`).
- embeddedstructfieldcheck # Embedded types should be at the top of the field list of a struct, and there must be an empty line separating embedded fields from regular fields. [fast]
Expand Down Expand Up @@ -49,10 +49,16 @@ linters:
- wrapcheck # Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false]
- zerologlint # Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg` [fast: false, auto-fix: false]
# Deprected linters
- gomodguard
- wsl

# https://golangci-lint.run/docs/linters/
settings:
gomoddirectives:
replace-local: true
goconst:
ignore-tests: true
min-occurrences: 5
exhaustive:
default-signifies-exhaustive: true
gocritic:
Expand All @@ -70,14 +76,17 @@ linters:
- legacy
- std-error-handling
rules:
- linters:
- gosec
path: example/
- linters:
- asasalint
path: (.+)_test\.go
paths:
- tmp
- third_party$
- builtin$
- examples$
- ^examples

formatters:
enable:
Expand All @@ -89,4 +98,4 @@ formatters:
- tmp
- third_party$
- builtin$
- examples$
- ^examples
File renamed without changes.
14 changes: 9 additions & 5 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
[tools]
# https://mise-tools.jdx.dev/tools/bun
bun = "1.3.2"
bun = "1.3.13"
# https://github.com/kubernetes-sigs/kind/releases
kind = "0.30.0"
# https://mise-tools.jdx.dev/tools/biome
biome = "2.3.15"
biome = "2.4.14"
# https://mise-tools.jdx.dev/tools/kubectl
kubectl = "1.36.0"
# https://mise-tools.jdx.dev/tools/lefthook
lefthook = "latest"
lefthook = "2.1.6"
# https://mise-tools.jdx.dev/tools/golangci-lint
golangci-lint = "latest"
golangci-lint = "2.12.2"
# https://github.com/kubernetes-sigs/controller-tools/releases
"github:kubernetes-sigs/controller-tools" = "0.20.1"
"github:kubernetes-sigs/controller-tools" = "0.21.0"
3 changes: 3 additions & 0 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"go.lintTool": "golangci-lint"
}
Loading