Skip to content

Commit 29450ae

Browse files
author
Maksim Sadym
committed
test.sh tests both CDDL and no splits
1 parent 89f7aea commit 29450ae

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
toolchain: stable
4545
- name: Validate CDDL files
46-
run: ./scripts/test.sh
46+
run: ./scripts/cddl/test.sh
4747
- name: Archive CDDL files
4848
uses: actions/upload-artifact@v3
4949
with:

scripts/cddl/test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /bin/bash
2+
set -ex
3+
4+
if ! [ -x "$(command -v cddl)" ] || [ "$1" = "--upgrade" ]; then
5+
echo 'Installing cddl'
6+
cargo install cddl
7+
fi
8+
9+
if [[ "$(npm list parse5)" =~ "empty" ]] || [ "$1" = "--upgrade" ]; then
10+
echo 'Installing npm package parse5'
11+
npm install parse5
12+
fi
13+
14+
# Extract CDDL content from spec into files
15+
$ROOT/scripts/cddl/generate.js
16+
17+
cddl compile-cddl --cddl local.cddl
18+
cddl compile-cddl --cddl remote.cddl

scripts/test.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,5 @@ set -ex
44
SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
55
ROOT=$(dirname $SCRIPT_DIR)
66

7-
if ! [ -x "$(command -v cddl)" ] || [ "$1" = "--upgrade" ]; then
8-
echo 'Installing cddl'
9-
cargo install cddl
10-
fi
11-
12-
if [[ "$(npm list parse5)" =~ "empty" ]] || [ "$1" = "--upgrade" ]; then
13-
echo 'Installing npm package parse5'
14-
npm install parse5
15-
fi
16-
17-
# Extract CDDL content from spec into files
18-
$ROOT/scripts/cddl/generate.js
19-
20-
cddl compile-cddl --cddl local.cddl
21-
cddl compile-cddl --cddl remote.cddl
7+
sh $ROOT/scripts/cddl/test.sh
8+
node $ROOT/scripts/formatter/no_split_var.js

0 commit comments

Comments
 (0)