diff --git a/.github/.hooks/pre-commit/quality b/.github/.hooks/pre-commit/quality.sh similarity index 87% rename from .github/.hooks/pre-commit/quality rename to .github/.hooks/pre-commit/quality.sh index 65fbec71..76a9ca76 100644 --- a/.github/.hooks/pre-commit/quality +++ b/.github/.hooks/pre-commit/quality.sh @@ -14,4 +14,8 @@ fi npm run test +npm run cypress:bash + npm run build + +npm run build:lib diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f59d2dcc..f6fe496e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -37,7 +37,7 @@ jobs: echo '********' echo "RELEASE_VERSION: $RELEASE_VERSION" echo '********' - bash .github/scripts/replace_template.sh $RELEASE_VERSION + bash .github/workflows/scripts/replace_template.sh $RELEASE_VERSION npm run build - name: Deploy demo diff --git a/.github/workflows/quality-check.yml b/.github/workflows/quality-check.yml index 2f2350ed..2b7be98e 100644 --- a/.github/workflows/quality-check.yml +++ b/.github/workflows/quality-check.yml @@ -16,5 +16,5 @@ jobs: run: | npm ci --force git submodule update --init --recursive --remote - bash .github/workflows/scripts/quality + bash .github/workflows/scripts/quality.sh diff --git a/.github/workflows/scripts/quality b/.github/workflows/scripts/quality deleted file mode 100644 index 16abae3c..00000000 --- a/.github/workflows/scripts/quality +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin - -set -e - -npm run lint -npm run cypress:bash -npm test -npm run build -npm run build:lib diff --git a/.github/workflows/scripts/quality.sh b/.github/workflows/scripts/quality.sh new file mode 100644 index 00000000..76a9ca76 --- /dev/null +++ b/.github/workflows/scripts/quality.sh @@ -0,0 +1,21 @@ +#!/usr/bin + +set -e + +npm run lint + +output=$(npm run type-coverage) +if echo "$output" | grep -q "lower than "; then + echo "$output" + exit 1 # Terminate the hook script with a non-zero exit code +else + echo "Type coverage is good! 🎉" +fi + +npm run test + +npm run cypress:bash + +npm run build + +npm run build:lib diff --git a/.github/scripts/replace_template.sh b/.github/workflows/scripts/replace_template.sh similarity index 83% rename from .github/scripts/replace_template.sh rename to .github/workflows/scripts/replace_template.sh index 2896a5c8..c589de8c 100755 --- a/.github/scripts/replace_template.sh +++ b/.github/workflows/scripts/replace_template.sh @@ -6,6 +6,9 @@ if [ $# -ne 1 ]; then exit 1 fi +current_directory=$(pwd) +echo "Current directory: $current_directory" + # Assign arguments to variables custom_string="$1"