-
Notifications
You must be signed in to change notification settings - Fork 116
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 f0a2b80
Showing
173 changed files
with
12,941 additions
and
11,752 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 }) |
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,31 @@ | ||
name: Upload main stats | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build_and_upload: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
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: Build | ||
run: npm run build:production; cp ./public/build-stats.json ./reference.json | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: main-stats | ||
path: ./reference.json |
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
Oops, something went wrong.