2021-11-30 16:00:59 +01:00
|
|
|
name: Stats
|
2021-02-23 09:44:40 +01:00
|
|
|
|
2024-10-31 07:05:35 +01:00
|
|
|
permissions: {}
|
|
|
|
|
2021-02-23 09:44:40 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
- ci
|
2021-03-11 11:17:42 +01:00
|
|
|
- next
|
2021-02-23 09:44:40 +01:00
|
|
|
pull_request:
|
|
|
|
types: [synchronize, opened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
stats:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
env:
|
|
|
|
CI_BRANCH_BASE: develop
|
|
|
|
|
|
|
|
steps:
|
2024-02-06 07:34:58 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-02-23 09:44:40 +01:00
|
|
|
|
2021-12-01 14:14:58 +01:00
|
|
|
- uses: './.github/actions/reusable-prepare-peertube-build'
|
2021-02-23 09:44:40 +01:00
|
|
|
with:
|
2023-10-11 13:59:24 +02:00
|
|
|
node-version: '18.x'
|
2021-02-23 09:44:40 +01:00
|
|
|
|
2024-07-02 14:06:52 +02:00
|
|
|
- name: Build
|
|
|
|
run: npm run build -- --analyze-bundle
|
|
|
|
|
2021-05-27 08:13:33 +02:00
|
|
|
- name: PeerTube code stats
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
|
|
|
|
unzip "scc-3.0.0-x86_64-unknown-linux.zip"
|
2023-07-31 14:34:36 +02:00
|
|
|
./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
|
2021-05-27 08:13:33 +02:00
|
|
|
|
2021-02-23 09:44:40 +01:00
|
|
|
- name: PeerTube client stats
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2024-07-03 15:59:26 +02:00
|
|
|
npm run -s client:build-stats > client-build-stats.json
|
2021-02-23 09:44:40 +01:00
|
|
|
|
2021-05-27 08:13:33 +02:00
|
|
|
- name: PeerTube client lighthouse report
|
2021-02-23 09:44:40 +01:00
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2021-05-27 08:13:33 +02:00
|
|
|
sudo apt-get install chromium-browser
|
|
|
|
sudo npm install -g lighthouse
|
|
|
|
lighthouse --chrome-flags="--headless" https://peertube2.cpy.re --output=json --output-path=./lighthouse.json
|
2021-02-23 09:44:40 +01:00
|
|
|
|
|
|
|
- name: Display stats
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
|
|
|
cat client-build-stats.json
|
|
|
|
cat scc.json
|
2021-05-27 08:13:33 +02:00
|
|
|
cat lighthouse.json
|
2021-02-23 09:44:40 +01:00
|
|
|
|
|
|
|
- name: Upload stats
|
|
|
|
if: github.event_name != 'pull_request'
|
2021-12-01 14:14:58 +01:00
|
|
|
uses: './.github/actions/reusable-deploy'
|
|
|
|
with:
|
|
|
|
source: lighthouse.json client-build-stats.json scc.json
|
|
|
|
destination: peertube-stats
|
|
|
|
knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
|
|
|
|
deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
|
|
|
|
deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
|
|
|
|
deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
|