stats.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Stats
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. - ci
  7. - next
  8. pull_request:
  9. types: [synchronize, opened]
  10. jobs:
  11. stats:
  12. runs-on: ubuntu-latest
  13. env:
  14. CI_BRANCH_BASE: develop
  15. steps:
  16. - uses: actions/checkout@v4
  17. - uses: './.github/actions/reusable-prepare-peertube-build'
  18. with:
  19. node-version: '18.x'
  20. - name: Angular bundlewatch
  21. uses: jackyef/bundlewatch-gh-action@master
  22. with:
  23. build-script: npm run build -- --analyze-bundle
  24. branch-base: develop
  25. bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
  26. - name: PeerTube code stats
  27. if: github.event_name != 'pull_request'
  28. run: |
  29. wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
  30. unzip "scc-3.0.0-x86_64-unknown-linux.zip"
  31. ./scc --format=json --exclude-dir .git,node_modules,client/node_modules,client/dist,dist,yarn.lock,client/yarn.lock,client/src/locale,test1,test2,test3,client/src/assets/images,config,storage,packages/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
  32. - name: PeerTube client stats
  33. if: github.event_name != 'pull_request'
  34. run: |
  35. npm run client:build-stats > client-build-stats.json
  36. - name: PeerTube client lighthouse report
  37. if: github.event_name != 'pull_request'
  38. run: |
  39. sudo apt-get install chromium-browser
  40. sudo npm install -g lighthouse
  41. lighthouse --chrome-flags="--headless" https://peertube2.cpy.re --output=json --output-path=./lighthouse.json
  42. - name: Display stats
  43. if: github.event_name != 'pull_request'
  44. run: |
  45. cat client-build-stats.json
  46. cat scc.json
  47. cat lighthouse.json
  48. - name: Upload stats
  49. if: github.event_name != 'pull_request'
  50. uses: './.github/actions/reusable-deploy'
  51. with:
  52. source: lighthouse.json client-build-stats.json scc.json
  53. destination: peertube-stats
  54. knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
  55. deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
  56. deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
  57. deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}