From ad25f8395449c9a1eda27916e330f96ae8177d6f Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Sat, 16 Jan 2021 03:35:10 +0300 Subject: [PATCH] Add size-limit to CI --- .github/workflows/ci-check-size-limit.yml | 19 +++++++++++++++++++ frontend/package.json | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci-check-size-limit.yml diff --git a/.github/workflows/ci-check-size-limit.yml b/.github/workflows/ci-check-size-limit.yml new file mode 100644 index 00000000..db3dade7 --- /dev/null +++ b/.github/workflows/ci-check-size-limit.yml @@ -0,0 +1,19 @@ +name: "check js/css bundles file limit" +on: + pull_request: + branches: + - master + paths: + - '.github/workflows/ci-test-frontend.yml' + - 'frontend/**/*.{ts,tsx,css}' +jobs: + size: + runs-on: ubuntu-latest + env: + CI_JOB_NUMBER: 1 + steps: + - uses: actions/checkout@v1 + - uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + directory: frontend/ \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index d441534c..6353eb63 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,10 +13,9 @@ "check": "cross-env NODE_ENV=production run-s build && run-p check:*", "check:types": "tsc -p tsconfig.json --noEmit", "check:translation": "run-s translation:extract translation:check", - "check:size": "size-limit", "lint:eslint": "eslint --max-warnings=0 '**/*.{ts?(x),js}'", "lint:stylelint": "stylelint 'app/**/*.css' 'templates/**'", - "size": "cross-env NODE_ENV=production run-s build check:size", + "size": "cross-env NODE_ENV=production npm run build && size-limit", "prettier": "prettier --write './**/*.{js,ts,tsx,css,html}'", "translation:extract": "formatjs extract --out-file=./extracted-messages/messages.json '**/!(*.d).ts?(x)'", "translation:generate": "node ./tasks/generateDictionary.js",