Add lighthouse to github action
This commit is contained in:
		
							parent
							
								
									35f676e5d3
								
							
						
					
					
						commit
						bfe6e0d9f7
					
				
					 1 changed files with 14 additions and 6 deletions
				
			
		
							
								
								
									
										20
									
								
								.github/workflows/stats.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/stats.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -45,11 +45,6 @@ jobs:
 | 
			
		|||
          branch-base: develop
 | 
			
		||||
          bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
 | 
			
		||||
 | 
			
		||||
      - name: PeerTube client stats
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
        run: |
 | 
			
		||||
          node dist/scripts/client-build-stats.js > client-build-stats.json
 | 
			
		||||
 | 
			
		||||
      - name: PeerTube code stats
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
        run: |
 | 
			
		||||
| 
						 | 
				
			
			@ -57,11 +52,24 @@ jobs:
 | 
			
		|||
          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,server/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
 | 
			
		||||
 | 
			
		||||
      - name: PeerTube client stats
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
        run: |
 | 
			
		||||
          node dist/scripts/client-build-stats.js > client-build-stats.json
 | 
			
		||||
 | 
			
		||||
      - name: PeerTube client lighthouse report
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
        run: |
 | 
			
		||||
          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
 | 
			
		||||
 | 
			
		||||
      - name: Display stats
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
        run: |
 | 
			
		||||
          cat client-build-stats.json
 | 
			
		||||
          cat scc.json
 | 
			
		||||
          cat lighthouse.json
 | 
			
		||||
 | 
			
		||||
      - name: Upload stats
 | 
			
		||||
        if: github.event_name != 'pull_request'
 | 
			
		||||
| 
						 | 
				
			
			@ -87,5 +95,5 @@ jobs:
 | 
			
		|||
 | 
			
		||||
          if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
 | 
			
		||||
            echo "Uploading files"
 | 
			
		||||
            scp client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
 | 
			
		||||
            scp lighthouse.json client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
 | 
			
		||||
          fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue