diff --git a/.github/workflows/statoscope-comment.jora b/.github/workflows/statoscope-comment.jora deleted file mode 100644 index 1a8a0cad..00000000 --- a/.github/workflows/statoscope-comment.jora +++ /dev/null @@ -1,43 +0,0 @@ -// 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(); -$before: resolveReferenceFile(); -$referenceCompilation: $before.compilations.pick(); -$referenceInitialCompilation: $before.compilations.chunks.filter(); - -// 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() - } -} diff --git a/.github/workflows/statoscope-comment.js b/.github/workflows/statoscope-comment.js deleted file mode 100644 index 4965c849..00000000 --- a/.github/workflows/statoscope-comment.js +++ /dev/null @@ -1,10 +0,0 @@ -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) -`; diff --git a/.github/workflows/statoscope.yml b/.github/workflows/statoscope.yml deleted file mode 100644 index b90d16e6..00000000 --- a/.github/workflows/statoscope.yml +++ /dev/null @@ -1,82 +0,0 @@ -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/github-script@v6.0.0 - with: - script: | - const createStatoscopeComment = require('./dev/createStatoscopeComment'); - await createStatoscopeComment({ github, context, core }) diff --git a/.github/workflows/upload-main-stats.yml b/.github/workflows/upload-main-stats.yml deleted file mode 100644 index 967b3f66..00000000 --- a/.github/workflows/upload-main-stats.yml +++ /dev/null @@ -1,31 +0,0 @@ -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 diff --git a/.gitignore b/.gitignore index 0982c478..abb30d47 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ trash/ coverage/ src/i18n/en.json notarization-error.log +.github/workflows/* +!.github/workflows/electron-release.yml