Skip to content

Commit

Permalink
validate_devfile_schemas.sh script unzips resource files if samples
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron committed May 23, 2024
1 parent 6ef053d commit a4ac51c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/validate-samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:

- name: Validate samples
if: ${{ env.STACKS != '' }}
run: STACKS_DIR=$(pwd)/samples/.cache bash tests/validate_devfile_schemas.sh
run: STACKS_DIR=$(pwd)/samples/.cache bash tests/validate_devfile_schemas.sh --samples
28 changes: 28 additions & 0 deletions tests/validate_devfile_schemas.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
#!/usr/bin/env bash

POSITIONAL_ARGS=()
SAMPLES="false"

while [[ $# -gt 0 ]]; do
case $1 in
-s|--samples)
SAMPLES="true"
shift # past argument
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done

set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
set -x

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

# Unzip resource files if samples
if [ "${SAMPLES}" == "true" ]; then
for sample_dir in $(ls $stacksDir); do
unzip -n $stacksDir/$sample_dir/sampleName.zip -d $stacksDir
done
fi

ginkgo run --procs 2 \
tests/validate_devfile_schemas -- -stacksPath ${stacksDir} -stackDirs "$stackDirs"

0 comments on commit a4ac51c

Please sign in to comment.