Skip to content

Commit

Permalink
build(scripts): 📦️ refactor scripts, fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kopach committed Feb 23, 2021
1 parent 4ada8b7 commit be78b04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setting up Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node-version }}
- name: install
run: |
npm ci
Expand Down
2 changes: 1 addition & 1 deletion scripts/seriesci-post-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ curl \
\"value\":\"${SERIE_VALUE}\",
\"sha\":\"${GIT_SHA}\"
}" \
https://seriesci.com/api/kopach/karma-sabarivka-reporter/${SERIE_NAME}/one
"https://seriesci.com/api/kopach/karma-sabarivka-reporter/${SERIE_NAME}/one"

echo ""
20 changes: 10 additions & 10 deletions scripts/seriesci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SERIESCI_TOKEN=$1

# More info on this: https://github.51.almunity/t/github-sha-not-the-same-as-the-triggering-commit/18286
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
GIT_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
GIT_SHA="$(cat "${GITHUB_EVENT_PATH}" | jq -r .pull_request.head.sha)"
else
GIT_SHA=$GITHUB_SHA
fi
Expand All @@ -20,13 +20,13 @@ echo "GIT_SHA: ${GIT_SHA}"

echo "post code coverage to seriesci"
COVERAGE="$(npx lcov-total coverage/lcov.info)%"
echo $COVERAGE
./scripts/seriesci-post-1.sh $SERIESCI_TOKEN $GIT_SHA "coverage" $COVERAGE
echo "${COVERAGE}"
./scripts/seriesci-post-1.sh "${SERIESCI_TOKEN}" "${GIT_SHA}" "coverage" "${COVERAGE}"

echo "post bundle size to seriesci"
BUNDLE_SIZE="$(du -sh dist/ | awk '{print $1}')"
echo $BUNDLE_SIZE
./scripts/seriesci-post-1.sh $SERIESCI_TOKEN $GIT_SHA "bundlesize" $BUNDLE_SIZE
echo "${BUNDLE_SIZE}"
./scripts/seriesci-post-1.sh "${SERIESCI_TOKEN}" "${GIT_SHA}" "bundlesize" "${BUNDLE_SIZE}"

echo "post lint & build & test execution time to seriesci"
duration_build=$(cat build-execution-time.log)
Expand All @@ -44,11 +44,11 @@ curl \
echo ""

echo "post number of dependencies to seriesci"
NUMBER_OF_DEPENDENCIES="$((npm ls --depth=0 --prod --parseable --silent || true) | grep -c node_modules)"
echo $NUMBER_OF_DEPENDENCIES
./scripts/seriesci-post-1.sh $SERIESCI_TOKEN $GIT_SHA "dependencies" "${NUMBER_OF_DEPENDENCIES}"
NUMBER_OF_DEPENDENCIES="$( (npm ls --depth=0 --prod --parseable --silent || true) | grep -c node_modules )"
echo "${NUMBER_OF_DEPENDENCIES}"
./scripts/seriesci-post-1.sh "${SERIESCI_TOKEN}" "${GIT_SHA}" "dependencies" "${NUMBER_OF_DEPENDENCIES}"

echo "post number of lines of code to seriesci"
NUMBER_OF_LINES="$(npx cloc src --csv | grep 'SUM.*' -o | cut -d, -f 4)"
echo $NUMBER_OF_LINES
./scripts/seriesci-post-1.sh $SERIESCI_TOKEN $GIT_SHA "lines-of-code" $NUMBER_OF_LINES
echo "${NUMBER_OF_LINES}"
./scripts/seriesci-post-1.sh "${SERIESCI_TOKEN}" "${GIT_SHA}" "lines-of-code" "${NUMBER_OF_LINES}"

0 comments on commit be78b04

Please sign in to comment.