]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .github/workflows/stats.yml
Use node 16 for tests
[github/Chocobozzz/PeerTube.git] / .github / workflows / stats.yml
CommitLineData
f3fbbf01 1name: Stats
2abaa3f2
C
2
3on:
4 push:
5 branches:
6 - develop
7 - ci
3fbc6974 8 - next
2abaa3f2
C
9 pull_request:
10 types: [synchronize, opened]
11
12jobs:
13
14 stats:
15 runs-on: ubuntu-latest
16
17 env:
18 CI_BRANCH_BASE: develop
19
20 steps:
388a31d2 21 - uses: actions/checkout@v3
2abaa3f2 22
51e9e152 23 - uses: './.github/actions/reusable-prepare-peertube-build'
2abaa3f2 24 with:
1f45f8b0 25 node-version: '16.x'
2abaa3f2 26
2abaa3f2
C
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
bfe6e0d9
C
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
2abaa3f2
C
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
bfe6e0d9 46 - name: PeerTube client lighthouse report
2abaa3f2
C
47 if: github.event_name != 'pull_request'
48 run: |
bfe6e0d9
C
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
2abaa3f2
C
52
53 - name: Display stats
54 if: github.event_name != 'pull_request'
55 run: |
56 cat client-build-stats.json
57 cat scc.json
bfe6e0d9 58 cat lighthouse.json
2abaa3f2
C
59
60 - name: Upload stats
61 if: github.event_name != 'pull_request'
51e9e152
C
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 }}