From a90a3fb95b1fcef2fb25bef36a021fd397145311 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Tue, 1 Nov 2022 13:18:02 +0100 Subject: [PATCH 1/3] GitHub: Add bundle-size PR reporter --- .github/workflows/bundle-size.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/bundle-size.yml diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml new file mode 100644 index 000000000..5d91ce03f --- /dev/null +++ b/.github/workflows/bundle-size.yml @@ -0,0 +1,27 @@ +name: Bundle-size + +on: [pull_request] + +jobs: + size: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: 14 + cache: yarn + + - uses: ./.github/actions/install-modules + + - name: Link locale packages and install their dependencies + run: yarn bootstrap + + - name: Build packages + run: yarn build + + - uses: preactjs/compressed-size-action@v2 + with: + pattern: '**/dist/**/*.{js,svg}' From 98413096faf263751b9618e31563bc784a24f900 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Wed, 2 Nov 2022 08:15:36 +0100 Subject: [PATCH 2/3] GitHub: Limit workflow scope for PRs targeting main --- .github/workflows/bundle-size.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index 5d91ce03f..ab2d1351d 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -1,6 +1,9 @@ name: Bundle-size -on: [pull_request] +on: + pull_request: + branches: + - main jobs: size: From 3b90bc93ff802e4472b49e872b53649534df8ece Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Wed, 2 Nov 2022 09:16:56 +0100 Subject: [PATCH 3/3] GitHub: Add cjs files to bundle-size glob pattern --- .github/workflows/bundle-size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index ab2d1351d..d38521696 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -27,4 +27,4 @@ jobs: - uses: preactjs/compressed-size-action@v2 with: - pattern: '**/dist/**/*.{js,svg}' + pattern: '**/dist/**/*.{cjs,js,svg}'