diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ea94efbb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: CUE Unity Test + +on: + push: + branches: + - '**' + +jobs: + test: + strategy: + fail-fast: false + matrix: + go-version: ['1.19'] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v3 + - run: go install github.com/cue-unity/unity/cmd/unity@latest + - run: unity test --verbose diff --git a/.gitignore b/.gitignore index 858c0893..951cc445 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ .idea cmd/thema/thema + +# Output from cue-unity +/.unity-bin diff --git a/cue.mod/tests/foo.txt b/cue.mod/tests/foo.txt new file mode 100644 index 00000000..0ebc256b --- /dev/null +++ b/cue.mod/tests/foo.txt @@ -0,0 +1,9 @@ +# Verify that eval works as expect + +cue eval $WORK/repo/testdata/foo.cue +cmp stdout $WORK/stdout.golden + +-- stdout.golden -- +renamed: "i'mma string" +all: 99999 +withDefault: "foo" | "bar" diff --git a/cue.mod/tests/tests.cue b/cue.mod/tests/tests.cue new file mode 100644 index 00000000..277daf78 --- /dev/null +++ b/cue.mod/tests/tests.cue @@ -0,0 +1,3 @@ +package tests + +Versions: ["go.mod", "v0.5.0"] diff --git a/testdata/foo.cue b/testdata/foo.cue new file mode 100644 index 00000000..87fe03a2 --- /dev/null +++ b/testdata/foo.cue @@ -0,0 +1,13 @@ +package schmoo + +import "github.com/grafana/thema/testdata/internal:thema" + +(thema.#Translate & { + lin: thema.basic + inst: { + all: 88888 + init: "i'mma string" + } + from: [0, 0] + to: [1, 0] +}).out.result.result