10 types: [synchronize, opened]
15 runs-on: ubuntu-latest
18 CI_BRANCH_BASE: develop
21 - uses: actions/checkout@v2
24 uses: actions/setup-node@v1
28 - name: Cache Node.js modules
29 uses: actions/cache@v2
33 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
35 ${{ runner.OS }}-node-
38 - name: Install dependencies
39 run: yarn install --frozen-lockfile
41 - name: Angular bundlewatch
42 uses: jackyef/bundlewatch-gh-action@master
44 build-script: npm run build -- --analyze-bundle
46 bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
48 - name: PeerTube code stats
49 if: github.event_name != 'pull_request'
51 wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
52 unzip "scc-3.0.0-x86_64-unknown-linux.zip"
53 ./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
55 - name: PeerTube client stats
56 if: github.event_name != 'pull_request'
58 node dist/scripts/client-build-stats.js > client-build-stats.json
60 - name: PeerTube client lighthouse report
61 if: github.event_name != 'pull_request'
63 sudo apt-get install chromium-browser
64 sudo npm install -g lighthouse
65 lighthouse --chrome-flags="--headless" https://peertube2.cpy.re --output=json --output-path=./lighthouse.json
68 if: github.event_name != 'pull_request'
70 cat client-build-stats.json
75 if: github.event_name != 'pull_request'
77 STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
78 STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
79 STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }}
80 STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
84 if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
85 echo "Adding ssh key to known hosts"
86 echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
91 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
92 echo "Adding ssh reployement key"
93 ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
96 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
97 echo "Uploading files"
98 scp lighthouse.json client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;