mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
CI: check generated code in test workflow (#3261)
This commit is contained in:
parent
3945a991bd
commit
897613e837
2 changed files with 14 additions and 2 deletions
12
.github/workflows/go-tests.yml
vendored
12
.github/workflows/go-tests.yml
vendored
|
@ -128,6 +128,18 @@ jobs:
|
|||
with:
|
||||
go-version: "1.22"
|
||||
|
||||
- name: Run "make generate" and check for changes
|
||||
run: |
|
||||
set -e
|
||||
make generate 2>/dev/null
|
||||
if [[ $(git status --porcelain) ]]; then
|
||||
echo "Error: Uncommitted changes found after running 'make generate'. Please commit all generated code."
|
||||
git diff
|
||||
exit 1
|
||||
else
|
||||
echo "No changes detected after running 'make generate'."
|
||||
fi
|
||||
|
||||
- name: Create localstack streams
|
||||
run: |
|
||||
aws --endpoint-url=http://127.0.0.1:4566 --region us-east-1 kinesis create-stream --stream-name stream-1-shard --shard-count 1
|
||||
|
|
|
@ -202,7 +202,7 @@ func (m *Machine) assignValues(columns []string, values []any) error {
|
|||
return fmt.Errorf("unexpected type %T for field hubstate", values[i])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &m.Hubstate); err != nil {
|
||||
return fmt.Errorf("parsing field hubstate: %w", err)
|
||||
return fmt.Errorf("unmarshal field hubstate: %w", err)
|
||||
}
|
||||
}
|
||||
case machine.FieldDatasources:
|
||||
|
@ -210,7 +210,7 @@ func (m *Machine) assignValues(columns []string, values []any) error {
|
|||
return fmt.Errorf("unexpected type %T for field datasources", values[i])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &m.Datasources); err != nil {
|
||||
return fmt.Errorf("parsing field datasources: %w", err)
|
||||
return fmt.Errorf("unmarshal field datasources: %w", err)
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue