-
Notifications
You must be signed in to change notification settings - Fork 212
34 lines (31 loc) · 1.21 KB
/
validate-components.yml
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
name: Validate Components
on: pull_request
jobs:
cue:
runs-on: ubuntu-24.04
environment: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.22'
- name: Install cue
run: |
go version
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')"
export PATH="$PATH:$GOPATH/bin"
pushd /tmp
GO111MODULE=on go install cuelang.org/go/cmd/cue@latest
popd
- name: Validate components.json conforms to cue schema
run: |
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')"
export PATH="$PATH:$GOPATH/bin"
cue vet -c ./schemas/components.cue ./parts/common/components.json
cue eval ./schemas/components.cue ./parts/common/components.json
- name: Validate windows_settings.json conforms to cue schema
run: |
GOPATH="$(go env | grep GOPATH | cut -d= -f2 | tr -d '"')"
export PATH="$PATH:$GOPATH/bin"
cue vet -c ./schemas/windows_settings.cue ./vhdbuilder/packer/windows/windows_settings.json
cue eval ./schemas/windows_settings.cue ./vhdbuilder/packer/windows/windows_settings.json