Skip to content

Commit 292bcfd

Browse files
committed
Check api example cbor in CI
1 parent d6103f5 commit 292bcfd

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

.github/workflows/check-examples.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check cbor examples
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
# Everyday at 4:00 AM
10+
- cron: "0 4 * * *"
11+
12+
jobs:
13+
check-cbor-examples:
14+
name: Check cbor examples
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install nix
20+
uses: cachix/install-nix-action@V27
21+
with:
22+
extra_nix_config: |
23+
accept-flake-config = true
24+
log-lines = 1000
25+
26+
- name: Enter nix shell
27+
uses: nicknovitski/nix-develop@v1
28+
29+
- run: |
30+
cd src/api
31+
cddl <(cat cddl/local-state-query.cddl cddl/getSystemStart.cddl) validate <(xxd -r -p examples/getSystemStart/result.cbor)

flake.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@
2525
mdbook-katex
2626
mdbook-alerts
2727
mdbook-toc
28+
29+
# to validate cbor / cddl
30+
cddl
31+
xxd
2832
];
2933
phases = [ "unpackPhase" "buildPhase" ];
3034
buildPhase = ''
3135
mdbook build -d $out
3236
'';
3337
}
3438
);
35-
defaultPackage = packages.mdbook;
39+
packages.default = packages.mdbook;
3640
}
3741
);
3842
}

src/api/cddl/local-state-query.cddl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ acquireFailurePointNotOnChain = 1
1818
failure = acquireFailurePointTooOld
1919
/ acquireFailurePointNotOnChain
2020

21-
$query = any
22-
$result = any
23-
2421
msgAcquire = [0, point]
2522
/ [8]
2623
/ [10]

0 commit comments

Comments
 (0)