-
Notifications
You must be signed in to change notification settings - Fork 212
61 lines (51 loc) · 1.9 KB
/
bundle_size.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Nuxt bundle size
on:
pull_request:
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
get-changes:
name: Get changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
frontend: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'frontend') }}
lint: ${{ contains(fromJson(steps.paths-filter.outputs.changes), 'lint') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get changes
id: paths-filter
uses: ./.github/actions/get-changes
build:
name: Check
runs-on: ubuntu-latest
if: |
github.repository == 'WordPress/openverse' &&
(needs.get-changes.outputs.frontend == 'true' || needs.get-changes.outputs.lint == 'true')
needs:
- get-changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup CI env
uses: ./.github/actions/setup-env
with:
setup_python: false
install_recipe: node-install
- uses: preactjs/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Only measure changes in the client, we don't care much about the size of the server bundles (I don't think?)
pattern: "./frontend/.nuxt/dist/client/**/*.{modern.js,js,css}"
exclude: "{./frontend/.nuxt/dist/client/lang-*.json.js,./frontend/.nuxt/dist/client/lang-*.json.modern.js}"
minimum-change-threshold: 10
build-script: --filter frontend build
- name: Checkout repository # again, to enable cleaning
if: always()
uses: actions/checkout@v4