PeerTube/.github/workflows/stats.yml

70 lines
2.3 KiB
YAML
Raw Normal View History

2021-11-30 09:00:59 -06:00
name: Stats
2021-02-23 02:44:40 -06:00
on:
push:
branches:
- develop
- ci
2021-03-11 04:17:42 -06:00
- next
2021-02-23 02:44:40 -06:00
pull_request:
types: [synchronize, opened]
jobs:
stats:
runs-on: ubuntu-latest
env:
CI_BRANCH_BASE: develop
steps:
2022-06-27 08:28:32 -05:00
- uses: actions/checkout@v3
2021-02-23 02:44:40 -06:00
2021-12-01 07:14:58 -06:00
- uses: './.github/actions/reusable-prepare-peertube-build'
2021-02-23 02:44:40 -06:00
with:
node-version: '18.x'
2021-02-23 02:44:40 -06:00
- name: Angular bundlewatch
uses: jackyef/bundlewatch-gh-action@master
with:
build-script: npm run build -- --analyze-bundle
branch-base: develop
bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
2021-05-27 01:13:33 -05: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"
./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 01:13:33 -05:00
2021-02-23 02:44:40 -06:00
- name: PeerTube client stats
if: github.event_name != 'pull_request'
run: |
npm run client:build-stats > client-build-stats.json
2021-02-23 02:44:40 -06:00
2021-05-27 01:13:33 -05:00
- name: PeerTube client lighthouse report
2021-02-23 02:44:40 -06:00
if: github.event_name != 'pull_request'
run: |
2021-05-27 01:13:33 -05: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 02:44:40 -06:00
- name: Display stats
if: github.event_name != 'pull_request'
run: |
cat client-build-stats.json
cat scc.json
2021-05-27 01:13:33 -05:00
cat lighthouse.json
2021-02-23 02:44:40 -06:00
- name: Upload stats
if: github.event_name != 'pull_request'
2021-12-01 07:14:58 -06: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 }}