Skip to content

Commit

Permalink
test.sh tests both CDDL and no splits
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Sadym committed Dec 5, 2022
1 parent 89f7aea commit 97fcc31
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
toolchain: stable
- name: Validate CDDL files
run: ./scripts/test.sh
run: ./scripts/cddl/test.sh
- name: Archive CDDL files
uses: actions/upload-artifact@v3
with:
Expand Down
21 changes: 21 additions & 0 deletions scripts/cddl/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/bash
set -ex

SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
ROOT=$(dirname $SCRIPT_DIR)

if ! [ -x "$(command -v cddl)" ] || [ "$1" = "--upgrade" ]; then
echo 'Installing cddl'
cargo install cddl
fi

if [[ "$(npm list parse5)" =~ "empty" ]] || [ "$1" = "--upgrade" ]; then
echo 'Installing npm package parse5'
npm install parse5
fi

# Extract CDDL content from spec into files
$ROOT/scripts/cddl/generate.js

cddl compile-cddl --cddl local.cddl
cddl compile-cddl --cddl remote.cddl
17 changes: 2 additions & 15 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,5 @@ set -ex
SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
ROOT=$(dirname $SCRIPT_DIR)

if ! [ -x "$(command -v cddl)" ] || [ "$1" = "--upgrade" ]; then
echo 'Installing cddl'
cargo install cddl
fi

if [[ "$(npm list parse5)" =~ "empty" ]] || [ "$1" = "--upgrade" ]; then
echo 'Installing npm package parse5'
npm install parse5
fi

# Extract CDDL content from spec into files
$ROOT/scripts/cddl/generate.js

cddl compile-cddl --cddl local.cddl
cddl compile-cddl --cddl remote.cddl
sh $ROOT/scripts/cddl/test.sh
node $ROOT/scripts/formatter/no_split_var.js

0 comments on commit 97fcc31

Please sign in to comment.