Choices/.github/workflows/bundlesize.yml
Konstantin Vyatkin 4acd6d6ca8 Improve GitHub actions and fix package.json SCSS script (#669)
* run actions on dependencies change

* add bundlesize token to master run

* fix bundlesize commit number

* add cypress env

* also run on - '.browserslistrc' changes

* update node-sass to allow install on Node 12 and trigger events

* use script

* add group

* skip husky on cypress

* upgrade csso dependency to make it trim sourcemaps

* fix run-p / run-s use

* remove commited assets on check

* commit assets

* remove cypress record

* restore recording

* reduce bundlesize limits

* try to specify key implicity

* remove Cypress recording

* restore build in bundlesize

* regenerate package-json.lock

* commit generated assets

* handle no-js case in lint

* fix lint error
2019-10-22 22:20:40 +01:00

43 lines
1 KiB
YAML

name: BundleSize
on:
pull_request:
paths:
- 'src/scripts/**'
- 'src/styles/**'
- 'package-lock.json'
- '.browserslistrc'
jobs:
measure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: 10
- name: Install dependencies and build
run: |
npm ci
npm run build
env:
CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true
# we don't need to build here, as even minized assets expected to be commited
- run: npx bundlesize
env:
CI: true
BUNDLESIZE_GITHUB_TOKEN: ${{secrets.BUNDLESIZE_GITHUB_TOKEN}}
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_REPO_OWNER: ${{ github.event.organization.login }}
CI_COMMIT_SHA: ${{ github.event.after }}
GIT_COMMIT: ${{ github.event.after }}
CI_BRANCH: ${{ github.head_ref }}
FORCE_COLOR: 2