-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f255c6
commit 7b946f9
Showing
173 changed files
with
2,356 additions
and
5,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Original: https://github.com/statoscope/statoscope.tech/blob/main/.github/workflows/statoscope-comment.jora | ||
|
||
// variables | ||
$after: resolveInputFile(); | ||
$inputCompilation: $after.compilations.pick(); | ||
$inputInitialCompilation: $after.compilations.chunks.filter(<initial>); | ||
$before: resolveReferenceFile(); | ||
$referenceCompilation: $before.compilations.pick(); | ||
$referenceInitialCompilation: $before.compilations.chunks.filter(<initial>); | ||
|
||
// helpers | ||
$getSizeByChunks: => files.(getAssetSize($$, true)).reduce(=> size + $$, 0); | ||
|
||
// output | ||
{ | ||
initialSize: { | ||
$after: $inputInitialCompilation.$getSizeByChunks($inputCompilation.hash); | ||
$before: $referenceInitialCompilation.$getSizeByChunks($referenceCompilation.hash); | ||
$after, | ||
$before, | ||
diff: { | ||
value: $after - $before, | ||
percent: $after.percentFrom($before, 2), | ||
formatted: { type: 'size', a: $before, b: $after } | formatDiff() + ` (${b.percentFrom(a, 2)}%)`, | ||
} | ||
}, | ||
bundleSize: { | ||
$after: $inputCompilation.chunks.$getSizeByChunks($inputCompilation.hash); | ||
$before: $referenceCompilation.chunks.$getSizeByChunks($referenceCompilation.hash); | ||
$after, | ||
$before, | ||
diff: { | ||
value: $after - $before, | ||
percent: $after.percentFrom($before, 2), | ||
formatted: { type: 'size', a: $before, b: $after } | formatDiff() + ` (${b.percentFrom(a, 2)}%)`, | ||
} | ||
}, | ||
validation: { | ||
$messages: resolveInputFile().compilations.[hash].(hash.validation_getItems()); | ||
$messages, | ||
total: $messages.size() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = ({ initialSize, bundleSize, validation, prNumber}) => `**📦 Statoscope quick diff with master branch:** | ||
**⚖️ Initial size:** ${initialSize.diff.percent > 1.5 ? '🔴' : (initialSize.diff.percent < 0 ? '🟢' : '⚪️')} ${initialSize.diff.percent > 0 ? '+' : ''}${initialSize.diff.formatted} | ||
**⚖️ Total bundle size:** ${bundleSize.diff.percent > 1.5 ? '🔴' : (bundleSize.diff.percent < 0 ? '🟢' : '⚪️')} ${bundleSize.diff.percent > 0 ? '+' : ''}${bundleSize.diff.formatted} | ||
**🕵️ Validation errors:** ${validation.total > 0 ? validation.total : '✅'} | ||
Full Statoscope report could be found [here️](https://deploy-preview-${prNumber}--mytonwallet-e5kxpi8iga.netlify.app/report.html) | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Statoscope Bundle Analytics | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- name: Reconfigure git to use HTTPS authentication | ||
uses: GuillaumeFalourd/SSH-to-HTTPS@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install | ||
run: npm ci | ||
- name: Cache results | ||
uses: actions/cache@v3 | ||
id: cache-results | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ github.sha }} | ||
statoscope: | ||
needs: | ||
- install | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
- name: Reconfigure git to use HTTPS authentication | ||
uses: GuillaumeFalourd/SSH-to-HTTPS@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Restore cache | ||
uses: actions/cache@v3 | ||
id: restore-cache | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ github.sha }} | ||
- name: Build | ||
run: npm run build:production; cp public/build-stats.json input.json | ||
- name: Download reference stats | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: upload-main-stats.yml | ||
workflow_conclusion: success | ||
name: main-stats | ||
path: ./ | ||
continue-on-error: true | ||
- name: Validate | ||
run: npm run statoscope:validate-diff | ||
- name: Query stats | ||
if: "github.event_name == 'pull_request'" | ||
run: cat .github/workflows/statoscope-comment.jora | npx --no-install @statoscope/cli query --input input.json --input reference.json > result.json | ||
- name: Hide bot comments | ||
uses: int128/hide-comment-action@v1 | ||
- name: Comment PR | ||
if: "github.event_name == 'pull_request'" | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
const createStatoscopeComment = require('./dev/createStatoscopeComment'); | ||
await createStatoscopeComment({ github, context, core }) |
Oops, something went wrong.