Skip to content

chore: compare compiled output fixes #3616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clean-donkeys-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-tools/gh-action-file-diff": major
---

This update optimizes and abstracts more the approach to comparing compiled assets. The input fields no focus on gathering package sources and more heavily relies on the exports field of the package.json to determine what assets should be compared. At the end of the processing and comparison, the diff assets are generated and a website built to review the updates.
18 changes: 9 additions & 9 deletions .github/actions/file-diff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ A GitHub Action for comparing compiled assets between branches.

**Required** Path to file or directory for file sizes analysis.

### `package-pattern`

**Required** All packages to include in the comparison. Supports glob syntax. Should point to the package folder which contains a package.json asset. If no package.json asset, this folder will be left off the results.

### `base-path`

**Optional** Path to another directory against which to perform file comparisons.
Expand All @@ -16,10 +20,6 @@ A GitHub Action for comparing compiled assets between branches.

**Optional** GitHub token for accessing the GitHub API. Defaults to `${{ github.token }}`.

### `file-glob-pattern`

**Optional** Glob pattern for selecting files to compare. Defaults to `dist/*`.

### `comment`

**Optional** If true, add a comment on the pull request with the results of the comparison. Defaults to `true`.
Expand All @@ -44,9 +44,9 @@ Total size of all files for this branch in bytes.
name: Compare compiled output file size
uses: "spectrum-tools/gh-action-file-diff"
with:
head-path: ${{ github.workspace }}/pull-request
base-path: ${{ github.workspace }}/base-branch
file-glob-pattern: |
components/*/dist/*.{css,json}
components/*/dist/themes/*.css
head-path: ${{ github.workspace }}/pull-request
base-path: ${{ github.workspace }}/base-branch
package-pattern: |
components/*/dist/*.{css,json}
components/*/dist/themes/*.css
```
7 changes: 3 additions & 4 deletions .github/actions/file-diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ inputs:
description: "GITHUB_TOKEN for the repository."
required: false
default: ${{ github.token }}
file-glob-pattern:
description: "Glob pattern for filtering of the files."
required: false
default: "**/dist/**"
package-pattern:
description: "Glob pattern for the package directories."
required: true
comment:
description: "Whether to comment on the PR."
required: false
Expand Down
Loading
Loading