Skip to content

Commit 10a3c5b

Browse files
committed
OSS step 1
1 parent 248254d commit 10a3c5b

38 files changed

+1452
-200
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file is for unifying the coding style for different editors and IDEs.
2+
# More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ensure that line endings on Windows builds are properly formatted
2+
*.go text eol=lf

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [jippi]

.github/dependabot.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "08:00"
8+
labels:
9+
- "dependencies"
10+
commit-message:
11+
prefix: "chore"
12+
include: "scope"
13+
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
time: "08:00"
19+
labels:
20+
- "dependencies"
21+
commit-message:
22+
prefix: "chore"
23+
include: "scope"
24+
25+
- package-ecosystem: "docker"
26+
directory: "/"
27+
schedule:
28+
interval: "daily"
29+
time: "08:00"
30+
labels:
31+
- "dependencies"
32+
commit-message:
33+
prefix: "chore"
34+
include: "scope"

.github/stale.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 14
3+
4+
# Number of days of inactivity before a stale issue is closed
5+
daysUntilClose: 7
6+
7+
# Issues with these labels will never be considered stale
8+
exemptLabels:
9+
- pinned
10+
- security
11+
12+
# Label to use when marking an issue as stale
13+
staleLabel: wontfix
14+
15+
# Comment to post when marking an issue as stale. Set to `false` to disable
16+
markComment: >
17+
This issue has been automatically marked as stale because it has not had
18+
recent activity. It will be closed if no further activity occurs. Thank you
19+
for your contributions.
20+
21+
# Comment to post when closing a stale issue. Set to `false` to disable
22+
closeComment: false

.github/workflows/build.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
pull_request:
9+
paths:
10+
- "go.*"
11+
- "**/*.go"
12+
- "Taskfile.yml"
13+
- "Dockerfile.release"
14+
- ".github/workflows/*.yml"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
# ------------------------------
21+
22+
govulncheck:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version-file: go.mod
30+
31+
- name: install govulncheck
32+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
33+
34+
- name: run govulncheck
35+
run: govulncheck ./...
36+
37+
# ------------------------------
38+
39+
semgrep:
40+
runs-on: ubuntu-latest
41+
container:
42+
image: returntocorp/semgrep
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: actions/checkout@v4
47+
with:
48+
repository: dgryski/semgrep-go
49+
path: rules
50+
51+
- uses: actions/setup-go@v5
52+
with:
53+
go-version-file: go.mod
54+
55+
- name: semgrep
56+
run: semgrep scan --error --enable-nosem -f ./rules .
57+
58+
# ------------------------------
59+
60+
test:
61+
runs-on: ubuntu-latest
62+
env:
63+
DOCKER_CLI_EXPERIMENTAL: "enabled"
64+
steps:
65+
- uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 0
68+
69+
- uses: arduino/setup-task@v2
70+
with:
71+
version: 3.x
72+
repo-token: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- uses: docker/setup-qemu-action@v3
75+
76+
- uses: docker/setup-buildx-action@v3
77+
78+
- name: setup-snapcraft
79+
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
83+
mkdir -p $HOME/.cache/snapcraft/download
84+
mkdir -p $HOME/.cache/snapcraft/stage-packages
85+
86+
- uses: actions/setup-go@v5
87+
with:
88+
go-version-file: go.mod
89+
90+
- uses: sigstore/cosign-installer@v3.5.0
91+
92+
- uses: anchore/sbom-action/download-syft@v0.15.11
93+
94+
- name: setup-validate-krew-manifest
95+
run: go install sigs.k8s.io/krew/cmd/validate-krew-manifest@latest
96+
97+
- name: setup-tparse
98+
run: go install github.com/mfridman/tparse@latest
99+
100+
- name: setup
101+
run: |
102+
task setup
103+
task build
104+
105+
- name: test
106+
run: ./scripts/test.sh
107+
108+
- name: Upload coverage reports to Codecov
109+
uses: codecov/codecov-action@v4
110+
with:
111+
token: ${{ secrets.CODECOV_TOKEN }}
112+
113+
- run: ./scm-engine
114+
115+
- run: git diff

.github/workflows/codeql.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
# ------------------------------
10+
11+
analyze:
12+
name: analyze
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
security-events: write
17+
actions: read
18+
contents: read
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
27+
- uses: github/codeql-action/init@v3
28+
29+
- uses: github/codeql-action/autobuild@v3
30+
31+
- uses: github/codeql-action/analyze@v3
32+
33+
# ------------------------------
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Dependency Review
2+
3+
on:
4+
- pull_request
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
# ------------------------------
11+
12+
dependency-review:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/dependency-review-action@v4
18+
with:
19+
allow-licenses: BSD-2-Clause, BSD-3-Clause, MIT, Apache-2.0, MPL-2.0
20+
21+
# ------------------------------

.github/workflows/gitleaks.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Gitleaks
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
# ------------------------------
16+
17+
gitleaks:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- uses: gitleaks/gitleaks-action@v2
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}
28+
if: ${{ env.GITLEAKS_LICENSE != '' }}
29+
30+
# ------------------------------

.github/workflows/grype.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Grype
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
11+
jobs:
12+
# ------------------------------
13+
14+
scan-source:
15+
name: scan-source
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
security-events: write
20+
actions: read
21+
contents: read
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: anchore/scan-action@v3
27+
with:
28+
path: "."
29+
fail-build: true
30+
31+
# ------------------------------

.github/workflows/lint.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
11+
permissions:
12+
# Required: allow read access to the content for analysis.
13+
contents: read
14+
15+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
16+
pull-requests: read
17+
18+
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
19+
checks: write
20+
21+
jobs:
22+
# ------------------------------
23+
24+
golangci-lint:
25+
name: lint
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version-file: go.mod
33+
cache: false
34+
35+
- name: golangci-lint
36+
uses: golangci/golangci-lint-action@v5
37+
with:
38+
args: --timeout=5m
39+
40+
# ------------------------------

0 commit comments

Comments
 (0)