feat(codegen): rename "fields" to "codegen" for more meaningful naming
This commit is contained in:
committed by
Mateusz Filipowicz
parent
f396b2f712
commit
e629288cba
9
.github/workflows/ci.yaml
vendored
9
.github/workflows/ci.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- uses: 'actions/setup-go@v5'
|
||||
- run: 'go build ./...'
|
||||
|
||||
generate:
|
||||
stringer:
|
||||
needs: 'build'
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
@@ -49,3 +49,10 @@ jobs:
|
||||
steps:
|
||||
- uses: 'actions/checkout@v4'
|
||||
- uses: 'ibiqlik/action-yamllint@v3'
|
||||
|
||||
test-codegen:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v4"
|
||||
- uses: "actions/setup-go@v5"
|
||||
- run: "go generate unifi/codegen.go"
|
||||
|
||||
8
.github/workflows/generate.yaml
vendored
8
.github/workflows/generate.yaml
vendored
@@ -4,9 +4,10 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch: {}
|
||||
pull_request: {}
|
||||
|
||||
permissions: "write-all"
|
||||
permissions:
|
||||
contents: "write"
|
||||
pull-requests: "write"
|
||||
|
||||
jobs:
|
||||
fields:
|
||||
@@ -16,9 +17,8 @@ jobs:
|
||||
|
||||
- uses: "actions/setup-go@v5"
|
||||
|
||||
|
||||
- name: "Generate new client structures"
|
||||
run: 'go generate unifi/fields.go'
|
||||
run: 'go generate unifi/codegen.go'
|
||||
|
||||
- name: "Read Unifi version marker"
|
||||
id: "unifi_version"
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Cache
|
||||
/fields/v*.*.*/
|
||||
/codegen/v*.*.*/
|
||||
|
||||
# goreleaser
|
||||
/dist/
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -17,6 +16,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/iancoleman/strcase"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/ulikunitz/xz"
|
||||
"github.com/xor-gate/ar"
|
||||
)
|
||||
@@ -22,6 +22,7 @@ func setupLogging(debugEnabled, traceEnabled bool) {
|
||||
log.SetFormatter(&log.TextFormatter{
|
||||
DisableTimestamp: true,
|
||||
DisableLevelTruncation: true,
|
||||
ForceColors: true,
|
||||
FullTimestamp: false,
|
||||
})
|
||||
if traceEnabled {
|
||||
@@ -2,4 +2,4 @@ package unifi
|
||||
|
||||
// This will generate the *.generated.go files in this package for the specified
|
||||
// Unifi controller version.
|
||||
//go:generate go run ../fields/ -version-base-dir=../fields/ latest
|
||||
//go:generate go run ../codegen/ -version-base-dir=../codegen/ latest
|
||||
Reference in New Issue
Block a user