Skip to content

Commit

Permalink
Merge pull request #57 from exoego/full-log
Browse files Browse the repository at this point in the history
ci: Split workflow
  • Loading branch information
exoego committed Jul 3, 2024
2 parents 7009004 + 11cdf31 commit 9a530d0
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 39 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/bundle-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: bundle analysis
on:
push:
branches: [main]
paths-ignore:
- '*.md'
pull_request_target:
branches: [main]

jobs:
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
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
19 changes: 2 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ on:
branches: [main]
paths-ignore:
- '*.md'
pull_request_target:
pull_request:
branches: [main]

jobs:
build:
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
steps:
Expand All @@ -27,6 +23,7 @@ jobs:
- run: npm run build
- name: Check uncommited file
run: |
git diff
git_diff_stat=$(git diff --stat)
if [[ $git_diff_stat != '' ]]; then
echo "Uncommitted file found. Ensure you have run tests and committed all changes."
Expand All @@ -36,15 +33,3 @@ jobs:
else
echo 'clean'
fi
- 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
Loading

0 comments on commit 9a530d0

Please sign in to comment.