Skip to content

Commit b5d9bf5

Browse files
committed
feat: initalise the go module
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
1 parent 2169b6b commit b5d9bf5

File tree

7 files changed

+209
-1
lines changed

7 files changed

+209
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
16+
jobs:
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
cache: false
27+
28+
- uses: golangci/golangci-lint-action@v8
29+
with:
30+
version: latest
31+
32+
test:
33+
name: Test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: actions/setup-go@v5
39+
with:
40+
go-version-file: go.mod
41+
cache: false
42+
43+
- uses: actions/cache@v4
44+
with:
45+
path: |
46+
~/.cache/go-build
47+
~/go/pkg/mod
48+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
49+
restore-keys: |
50+
${{ runner.os }}-go-
51+
52+
- uses: arduino/setup-task@v2
53+
54+
- run: task test
55+
56+
vuln:
57+
name: Vulnerability Check
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: golang/govulncheck-action@v1
63+
with:
64+
go-version-file: go.mod
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Validate PR Title
5+
6+
on:
7+
pull_request_target:
8+
types:
9+
- opened
10+
- edited
11+
- synchronize
12+
13+
jobs:
14+
validate:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v6
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CLAUDE.md
2+
.claude

.golangci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
run:
5+
concurrency: 4
6+
timeout: 10m
7+
issues-exit-code: 1
8+
tests: true
9+
modules-download-mode: readonly
10+
allow-parallel-runners: true
11+
12+
issues:
13+
exclude-dirs:
14+
- third-party
15+
skip-dirs-use-default: false
16+
17+
output:
18+
formats:
19+
- format: colored-line-number
20+
path: stdout
21+
print-issued-lines: true
22+
print-linter-name: true
23+
24+
linters-settings:
25+
govet:
26+
shadow: true
27+
enable-all: true
28+
disable:
29+
- fieldalignment
30+
31+
revive:
32+
min-confidence: 0.8
33+
34+
gofmt:
35+
simplify: true
36+
37+
goimports:
38+
local-prefixes: github.com/agntcy/slim-a2a-go
39+
40+
misspell:
41+
locale: US
42+
43+
depguard:
44+
rules:
45+
denied-deps:
46+
deny:
47+
- pkg: go.uber.org/atomic
48+
desc: "Use 'sync/atomic' instead of go.uber.org/atomic"
49+
- pkg: github.com/pkg/errors
50+
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"
51+
- pkg: github.com/hashicorp/go-multierror
52+
desc: "Use go.uber.org/multierr instead of github.com/hashicorp/go-multierror"
53+
54+
lll:
55+
line-length: 120
56+
tab-width: 1
57+
58+
linters:
59+
enable:
60+
- depguard
61+
- errcheck
62+
- errorlint
63+
- copyloopvar
64+
- gocritic
65+
- gofmt
66+
- goimports
67+
- gosec
68+
- govet
69+
- misspell
70+
- revive
71+
- staticcheck
72+
- tenv
73+
- unconvert
74+
- unused
75+
- unparam
76+
- lll

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# slim-a2a-go
1+
# slim-a2a-go

Taskfile.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
version: "3"
5+
6+
tasks:
7+
default:
8+
desc: List available tasks
9+
cmds:
10+
- task --list
11+
silent: true
12+
13+
lint:
14+
desc: Run golangci-lint
15+
cmds:
16+
- golangci-lint run ./...
17+
18+
fmt:
19+
desc: Format Go source files with goimports
20+
cmds:
21+
- goimports -w .
22+
23+
test:
24+
desc: Run all tests
25+
cmds:
26+
- go test -v ./...
27+
28+
test-coverage:
29+
desc: Run tests with coverage report
30+
cmds:
31+
- go test -coverprofile=coverage.out ./...
32+
- go tool cover -html=coverage.out -o coverage.html
33+
silent: true
34+
35+
generate:
36+
desc: Generate protobuf and slimrpc stubs (requires buf and protoc-gen-slimrpc-go)
37+
cmds:
38+
- |
39+
find . -name 'buf.gen.yaml' | while read -r file; do
40+
folder=$(dirname "$file")
41+
echo "Generating proto files for $folder"
42+
pushd > /dev/null "$folder" && buf generate && popd > /dev/null
43+
done

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/agntcy/slim-a2a-go
2+
3+
go 1.25.2

0 commit comments

Comments
 (0)