Skip to content

Commit a4ac51c

Browse files
validate_devfile_schemas.sh script unzips resource files if samples
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
1 parent 6ef053d commit a4ac51c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/validate-samples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ jobs:
6464

6565
- name: Validate samples
6666
if: ${{ env.STACKS != '' }}
67-
run: STACKS_DIR=$(pwd)/samples/.cache bash tests/validate_devfile_schemas.sh
67+
run: STACKS_DIR=$(pwd)/samples/.cache bash tests/validate_devfile_schemas.sh --samples

tests/validate_devfile_schemas.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
#!/usr/bin/env bash
22

3+
POSITIONAL_ARGS=()
4+
SAMPLES="false"
5+
6+
while [[ $# -gt 0 ]]; do
7+
case $1 in
8+
-s|--samples)
9+
SAMPLES="true"
10+
shift # past argument
11+
;;
12+
-*|--*)
13+
echo "Unknown option $1"
14+
exit 1
15+
;;
16+
*)
17+
POSITIONAL_ARGS+=("$1") # save positional arg
18+
shift # past argument
19+
;;
20+
esac
21+
done
22+
23+
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
324
set -x
425

526
stacksDir=${STACKS_DIR:-stacks}
@@ -10,5 +31,12 @@ if [[ ! ${stacksDir} = /* ]]; then
1031
stacksDir=$(pwd)/${stacksDir}
1132
fi
1233

34+
# Unzip resource files if samples
35+
if [ "${SAMPLES}" == "true" ]; then
36+
for sample_dir in $(ls $stacksDir); do
37+
unzip -n $stacksDir/$sample_dir/sampleName.zip -d $stacksDir
38+
done
39+
fi
40+
1341
ginkgo run --procs 2 \
1442
tests/validate_devfile_schemas -- -stacksPath ${stacksDir} -stackDirs "$stackDirs"

0 commit comments

Comments
 (0)