Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5eb0e289a1 |
@@ -12,49 +12,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.25"
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
- name: JSON syntax check
|
- name: JSON syntax check
|
||||||
run: |
|
run: |
|
||||||
for f in profiles/*.json; do
|
for f in profiles/*.json; do
|
||||||
echo "checking $f"
|
echo "checking $f"
|
||||||
python3 -m json.tool "$f" > /dev/null
|
python3 -m json.tool "$f" > /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Schema validation via pda-fieldbus loader
|
|
||||||
working-directory: ${{ runner.temp }}
|
|
||||||
run: |
|
|
||||||
mkdir -p validator && cd validator
|
|
||||||
go mod init validator
|
|
||||||
go get github.com/pdat-cz/pda-fieldbus@latest
|
|
||||||
cat > main.go <<'EOF'
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/pdat-cz/pda-fieldbus/pkg/proto/profile"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
if len(os.Args) != 2 {
|
|
||||||
fmt.Fprintln(os.Stderr, "usage: validator <profiles-dir>")
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
m, err := profile.LoadDirs(os.Args[1])
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintln(os.Stderr, "FAIL:", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
for n, p := range m {
|
|
||||||
fmt.Printf("OK %s device=%s/%s points=%d derived=%d\n",
|
|
||||||
n, p.Device.Manufacturer, p.Device.Model,
|
|
||||||
len(p.Points), len(p.Derived))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
go run . "$GITHUB_WORKSPACE/profiles"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user