Skip to content

Commit

Permalink
add environment identifier
Browse files Browse the repository at this point in the history
also add CI for automatically testing schema and examples

Signed-off-by: Thomas Fossati <[email protected]>
  • Loading branch information
thomas-fossati committed Jan 22, 2024
1 parent 7ec3413 commit 78bb594
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install CDDL and CBOR tooling
run: gem install --user-install cbor-diag cddl
- name: setup PATH
run: echo "$(gem env gempath | cut -d':' -f1)/bin" >> $GITHUB_PATH
- name: check schema and examples
run: make -C matcher-musings
9 changes: 8 additions & 1 deletion matcher-musings/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Examples := $(wildcard *.json)
Manifest := manifest.cddl

all: $(Manifest) $(Examples)
all: schema examples

.PHONY: schema
schema: $(Manifest)
@cddl $< g 1

.PHONY: examples
examples: $(Manifest) $(Examples)
@for f in $(Examples); do \
echo ">> validating $$f against $<" ; \
cddl $< validate $$f || exit 1 ; \
Expand Down
6 changes: 3 additions & 3 deletions matcher-musings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ claim-id = text / int

```cddl
RV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
}
```
Expand All @@ -41,7 +41,7 @@ RV = {

```cddl
xRV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
reason: $reason
}
Expand All @@ -54,7 +54,7 @@ $reason /= "insecure"

```cddl
EV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
claims: named-claims
}
Expand Down
6 changes: 3 additions & 3 deletions matcher-musings/manifest.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ named-claims = {
}

RV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
}

EV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
claims: named-claims
}

xRV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
reason: $reason
}
Expand Down

0 comments on commit 78bb594

Please sign in to comment.