-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
199 changed files
with
311,311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_size = 4 | ||
|
||
[*.{yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{json,json5}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.sh] | ||
indent_style = space |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Default owner | ||
* @heathcliff26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"username": "bot-ahsoka[bot]", | ||
"gitAuthor": "bot-ahsoka[bot] <bot-ahsoka[bot]@users.noreply.github.com>", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended", | ||
"docker:enableMajor", | ||
":disableRateLimiting", | ||
":dependencyDashboard", | ||
":semanticCommits", | ||
":automergeDigest", | ||
"github>heathcliff26/ci//renovate/commitMessage.json5", | ||
"github>heathcliff26/ci//renovate/customManagers.json5", | ||
"github>heathcliff26/ci//renovate/group-gomod.json5", | ||
"github>heathcliff26/ci//renovate/labels.json5", | ||
"github>heathcliff26/ci//renovate/semanticCommits.json5", | ||
"helpers:pinGitHubActionDigests" | ||
], | ||
"assigneesFromCodeOwners": true, | ||
"dependencyDashboardTitle": "Renovate Dashboard 🤖", | ||
"suppressNotifications": ["prIgnoreNotification"], | ||
"postUpdateOptions": ["gomodTidy"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: "Use to set tag, default: rolling" | ||
type: string | ||
default: "rolling" | ||
required: false | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- "go.mod" | ||
- "go.sum" | ||
- "*.go" | ||
- "**/*.go" | ||
- "Dockerfile" | ||
pull_request: | ||
branches: ["main"] | ||
merge_group: | ||
branches: ["main"] | ||
|
||
jobs: | ||
lint: | ||
uses: heathcliff26/ci/.github/workflows/golang-lint.yaml@main | ||
|
||
build: | ||
uses: heathcliff26/ci/.github/workflows/build-container.yaml@main | ||
needs: | ||
- lint | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
dockerfile: Dockerfile | ||
tag: "${{ github.event.inputs.tag }}" | ||
dry-run: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: "Editorconfig Check" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main", "renovate/*"] | ||
pull_request: | ||
branches: ["main"] | ||
merge_group: | ||
branches: ["main"] | ||
|
||
jobs: | ||
check-editorconfig: | ||
uses: heathcliff26/ci/.github/workflows/editorconfig-check.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: "Generate go test cover report" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- "*.go" | ||
- "**/*.go" | ||
|
||
jobs: | ||
generate-reports: | ||
uses: heathcliff26/ci/.github/workflows/golang-testcover-report.yaml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: "Labels Check" | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
|
||
jobs: | ||
check-labels: | ||
permissions: | ||
pull-requests: read | ||
uses: heathcliff26/ci/.github/workflows/label-check.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: "Link Check" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
check-links: | ||
uses: heathcliff26/ci/.github/workflows/link-check.yaml@main | ||
secrets: inherit | ||
with: | ||
exclude-paths: "vendor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: "Validate Renovate Config" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- .github/renovate-bot.json5 | ||
- .github/renovate.json5 | ||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- .github/renovate-bot.json5 | ||
- .github/renovate.json5 | ||
- .github/workflows/renovate-config-validator.yaml | ||
merge_group: | ||
branches: ["main"] | ||
|
||
jobs: | ||
validate-renovate-config: | ||
uses: heathcliff26/ci/.github/workflows/renovate-config-validator.yaml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
name: "Renovate" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
description: "dry-run" | ||
default: "false" | ||
required: false | ||
log-level: | ||
description: "log-level" | ||
default: debug | ||
required: false | ||
schedule: | ||
- cron: "10 * * * 5" | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- .github/renovate-bot.json5 | ||
- .github/renovate.json5 | ||
|
||
env: | ||
LOG_LEVEL: debug | ||
RENOVATE_DRY_RUN: false | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dry-run: ${{ steps.config.outputs.dry-run }} | ||
log-level: "${{ steps.config.outputs.log-level }}" | ||
steps: | ||
- name: Generate config from dispatch variables or defaults | ||
id: config | ||
run: | | ||
echo "dry-run=${{ github.event.inputs.dry-run || env.RENOVATE_DRY_RUN }}" >> "$GITHUB_OUTPUT" | ||
echo "log-level=${{ github.event.inputs.log-level || env.LOG_LEVEL }}" >> "$GITHUB_OUTPUT" | ||
renovate: | ||
needs: prepare | ||
uses: heathcliff26/ci/.github/workflows/renovate.yaml@main | ||
with: | ||
dry-run: ${{ needs.prepare.outputs.dry-run }} | ||
log-level: "${{ needs.prepare.outputs.log-level }}" | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Ignore binaries | ||
/bin | ||
|
||
# Generated go-test coverage reports | ||
coverprofiles/ | ||
|
||
# Ignore files created for testing | ||
test-config.yaml | ||
test.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
run: | ||
timeout: 1m | ||
tests: true | ||
skip-dirs-use-default: true | ||
modules-download-mode: readonly | ||
output: | ||
format: colored-line-number | ||
print-issued-lines: true | ||
print-linter-name: true | ||
unique-by-line: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"EditorConfig.EditorConfig", | ||
"GitHub.vscode-github-actions", | ||
"mrmlnc.vscode-json5", | ||
"redhat.vscode-yaml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
############################################################################### | ||
# BEGIN build-stage | ||
# Compile the binary | ||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22.1@sha256:0b55ab82ac2a54a6f8f85ec8b943b9e470c39e32c109b766bbc1b801f3fa8d3b AS build-stage | ||
|
||
ARG BUILDPLATFORM | ||
ARG TARGETARCH | ||
|
||
WORKDIR /app | ||
|
||
COPY vendor ./vendor | ||
COPY go.mod go.sum ./ | ||
COPY cmd ./cmd | ||
COPY pkg ./pkg | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux GOARCH="${TARGETARCH}" go build -ldflags="-w -s" -o /fleetlock ./cmd/ | ||
|
||
# | ||
# END build-stage | ||
############################################################################### | ||
|
||
############################################################################### | ||
# BEGIN test-stage | ||
# Run the tests in the container | ||
FROM docker.io/library/golang:1.22.1@sha256:0b55ab82ac2a54a6f8f85ec8b943b9e470c39e32c109b766bbc1b801f3fa8d3b AS test-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build-stage /app /app | ||
# Not needed for testing, but needed for later stage | ||
COPY --from=build-stage /fleetlock / | ||
|
||
RUN go test -v ./... | ||
|
||
# | ||
# END test-stage | ||
############################################################################### | ||
|
||
############################################################################### | ||
# BEGIN final-stage | ||
# Create final docker image | ||
FROM scratch AS final-stage | ||
|
||
WORKDIR / | ||
|
||
COPY --from=test-stage /fleetlock / | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["/fleetlock"] | ||
|
||
# | ||
# END final-stage | ||
############################################################################### |
Oops, something went wrong.