From 48037cb2904b7ec6cd9f73683d5a54698d7f3334 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Tue, 21 Dec 2021 14:56:38 +0800 Subject: [PATCH] build: update CI --- .github/workflows/nodejs.yml | 3 ++- src/assets/img/icons.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 2e206c11..a6ff2eba 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -47,9 +47,10 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: npm install, build, and test + - name: npm install, lint, build, and test run: | npm install + npm run lint npm run build --if-present npm run test:unit env: diff --git a/src/assets/img/icons.js b/src/assets/img/icons.js index e9dea3ed..8c669f60 100755 --- a/src/assets/img/icons.js +++ b/src/assets/img/icons.js @@ -14,14 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const requireComponent = require.context('../../assets', false, /\.png$/); +const requireComponent = require.context("../../assets", false, /\.png$/); const result = {}; function capitalizeFirstLetter(str) { return str.toUpperCase(); } function validateFileName(str) { - return /^\S+\.png$/.test(str) && str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) => capitalizeFirstLetter($1)); + return ( + /^\S+\.png$/.test(str) && + str.replace(/^\S+\/(\w+)\.png$/, (rs, $1) => capitalizeFirstLetter($1)) + ); } requireComponent.keys().forEach((filePath) => { const componentConfig = requireComponent(filePath);