Skip to content

Commit

Permalink
Merge pull request #62 from exoego/wip
Browse files Browse the repository at this point in the history
Run different analysis job for fork
  • Loading branch information
exoego committed Jul 30, 2024
2 parents eeb7d6f + 38a3b13 commit c2c4d18
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/bundle-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ on:
pull_request_target:
branches: [main]


jobs:
bundle-analysis:
bundle-analysis-from-fork:
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.user.login == 'exoego'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/ci-from-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI (from fork)
on:
push:
branches: [main]
paths-ignore:
- '*.md'
pull_request_target:
branches: [main]


jobs:
bundle-analysis-from-fork:
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.user.login != 'exoego'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- name: Analyze esbuild bundle size
uses: jenseng/dynamic-uses@5175289a9a87978dcfcb9cf512b821d23b2a53eb
with:
uses: exoego/esbuild-bundle-analyzer@${{ github.sha }}
with: '{"metafiles": "tmp/meta.json"}'
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
name: distribution
path: |
dist/
action.yaml
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,32 @@ jobs:
else
echo 'clean'
fi
bundle-analysis:
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.user.login == 'exoego'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
- name: Analyze esbuild bundle size
uses: jenseng/dynamic-uses@5175289a9a87978dcfcb9cf512b821d23b2a53eb
with:
uses: exoego/esbuild-bundle-analyzer@${{ github.sha }}
with: '{"metafiles": "tmp/meta.json"}'
- uses: actions/upload-artifact@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
name: distribution
path: |
dist/
action.yaml
4 changes: 2 additions & 2 deletions dist/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function markdownTable(
.join("");

return `
Meta File | Out File | Size (raw) | Note
Meta File | Out File | Size (raw) | Note
----------|----------|-----------:|------
${rows}`;
}
Expand Down

0 comments on commit c2c4d18

Please sign in to comment.