-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (38 loc) · 1.72 KB
/
Copy pathcodegen.yml
File metadata and controls
47 lines (38 loc) · 1.72 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
41
42
43
44
45
46
47
name: Code Generation Check
on:
pull_request:
paths:
- 'pkg/domain/interfaces/*.go'
- 'pkg/controller/http/*.go'
- 'pkg/domain/model/message/*.go'
- 'graphql/**'
- 'gqlgen.yml'
- 'Taskfile.yml'
- '.github/workflows/codegen.yml'
jobs:
check-codegen:
runs-on: ubuntu-latest
steps:
- name: Run cicd-sensor
uses: cicd-sensor/cicd-sensor-action@6ee257338e68af2b279b321b3346fe5f385aa498 # v0.0.29
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
cache-dependency-path: go.sum
- name: Install code generators
run: |
go install github.com/matryer/moq@latest
go install github.com/99designs/gqlgen@latest
- name: Generate mock files
run: |
go tool moq -out pkg/domain/mock/interfaces.go -pkg mock -rm -skip-ensure -stub pkg/domain/interfaces SlackClient SlackThreadService ChatNotifier Notifier Repository PolicyClient EmbeddingClient StorageClient LLMClient LLMSession SlackEventUsecases SlackInteractionUsecases AlertUsecases PromptService
go tool moq -out pkg/domain/model/message/mock_test.go -pkg message_test -rm -skip-ensure -stub pkg/domain/model/message HTTPClient
go tool moq -out pkg/controller/http/mock_test.go -pkg http_test -rm -skip-ensure -stub pkg/controller/http UseCase
- name: Generate GraphQL code
run: go tool gqlgen generate
- name: Check for uncommitted changes
run: |
git diff --exit-code || (echo "Error: Generated code is out of sync. Please run 'task mock' and 'task graphql' and commit the changes." && exit 1)