Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example to attach Thema to Unity #163

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
.idea

cmd/thema/thema

# Output from cue-unity
/.unity-bin
9 changes: 9 additions & 0 deletions cue.mod/tests/foo.txt
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions cue.mod/tests/tests.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package tests

Versions: ["go.mod", "v0.5.0"]
13 changes: 13 additions & 0 deletions testdata/foo.cue
Original file line number Diff line number Diff line change
@@ -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