]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - .github/workflows/stats.yml
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / .github / workflows / stats.yml
1 name: Stats
2
3 on:
4 push:
5 branches:
6 - develop
7 - ci
8 - next
9 pull_request:
10 types: [synchronize, opened]
11
12 jobs:
13
14 stats:
15 runs-on: ubuntu-latest
16
17 env:
18 CI_BRANCH_BASE: develop
19
20 steps:
21 - uses: actions/checkout@v3
22
23 - uses: './.github/actions/reusable-prepare-peertube-build'
24 with:
25 node-version: '16.x'
26
27 - name: Angular bundlewatch
28 uses: jackyef/bundlewatch-gh-action@master
29 with:
30 build-script: npm run build -- --analyze-bundle
31 branch-base: develop
32 bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
33
34 - name: PeerTube code stats
35 if: github.event_name != 'pull_request'
36 run: |
37 wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
38 unzip "scc-3.0.0-x86_64-unknown-linux.zip"
39 ./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,server/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
40
41 - name: PeerTube client stats
42 if: github.event_name != 'pull_request'
43 run: |
44 node dist/scripts/client-build-stats.js > client-build-stats.json
45
46 - name: PeerTube client lighthouse report
47 if: github.event_name != 'pull_request'
48 run: |
49 sudo apt-get install chromium-browser
50 sudo npm install -g lighthouse
51 lighthouse --chrome-flags="--headless" https://peertube2.cpy.re --output=json --output-path=./lighthouse.json
52
53 - name: Display stats
54 if: github.event_name != 'pull_request'
55 run: |
56 cat client-build-stats.json
57 cat scc.json
58 cat lighthouse.json
59
60 - name: Upload stats
61 if: github.event_name != 'pull_request'
62 uses: './.github/actions/reusable-deploy'
63 with:
64 source: lighthouse.json client-build-stats.json scc.json
65 destination: peertube-stats
66 knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
67 deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
68 deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
69 deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}