зеркало из https://github.com/microsoft/keyborg.git
45 строки
1.2 KiB
YAML
45 строки
1.2 KiB
YAML
name: Bundle size
|
|
on:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
# see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
bundle-size:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
cache: npm
|
|
node-version: 20
|
|
|
|
- run: npm ci
|
|
|
|
- name: Build packages & create reports
|
|
run: npm run bundle-size
|
|
|
|
- name: Compare bundle size with base
|
|
run: npx monosize compare-reports --branch=${{ github.event.pull_request.base.ref }} --output=markdown --quiet > ./monosize-report.md --report-files-glob="dist/bundle-size/monosize.json"
|
|
|
|
|
|
- name: Save PR number
|
|
run: echo ${{ github.event.number }} > pr.txt
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: monosize-report
|
|
retention-days: 1
|
|
if-no-files-found: error
|
|
path: |
|
|
monosize-report.md
|
|
pr.txt
|