-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
40 lines (33 loc) · 1.04 KB
/
Copy pathTaskfile.yml
File metadata and controls
40 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
version: "3"
tasks:
oas-download:
desc: Download OpenAPI specification (pin with SCHEMAS_REF=refs/tags/vX.Y.Z, a branch ref, or a SHA)
cmds:
- curl -fsSL -o openapi.yaml "https://raw.githubusercontent.com/inference-gateway/schemas/{{.SCHEMAS_REF | default "refs/heads/main"}}/openapi.yaml"
oas-sync:
desc: Fetch the OpenAPI spec (pin with SCHEMAS_REF) and regenerate types
cmds:
- task: oas-download
- task: generate
generate:
desc: Generate Go types from OpenAPI specification
cmds:
- go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.8.0 --config oapi-codegen.yaml openapi.yaml
- gofmt -r 'interface{} -> any' -w generated_types.go
lint:
desc: Runs golangci-lint
cmds:
- golangci-lint run
tidy:
desc: Runs go mod tidy
cmds:
- find . -name go.mod -execdir go mod tidy \;
test:
desc: Runs go test
cmds:
- go test -v ./...
docs:
desc: Run http server on port :6060 with documentation
cmds:
- godoc -http=:6060