13 runs-on: ubuntu-latest
26 POSTGRES_USER: peertube
27 POSTGRES_HOST_AUTH_METHOD: trust
34 - uses: actions/checkout@v2
36 - uses: './.github/actions/reusable-prepare-peertube-build'
40 - uses: './.github/actions/reusable-prepare-peertube-run'
44 startClient=`date +%s`
47 clientBuildTime=$((endClient-startClient))
49 startServer=`date +%s`
52 serverBuildTime=$((endServer-startServer))
54 echo '{"clientBuildTime":'$clientBuildTime',"serverBuildTime":'$serverBuildTime'}'> build-time.json
58 npm run clean:server:test
60 startCold=`date +%s%3N`
61 NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup
63 coldStartupTime=$(echo "scale=2; ($endCold-$startCold)/1000" | bc)
65 startHot=`date +%s%3N`
66 NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup
68 hotStartupTime=$(echo "scale=2; ($endHot-$startHot)/1000" | bc)
70 echo '{"coldStartupTime":'$coldStartupTime',"hotStartupTime":'$hotStartupTime'}'> startup-time.json
74 node dist/scripts/benchmark.js benchmark.json
76 - name: Display result
78 cat benchmark.json build-time.json startup-time.json
80 - name: Upload benchmark result
81 uses: './.github/actions/reusable-deploy'
83 source: benchmark.json build-time.json startup-time.json
84 destination: peertube-stats
85 knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
86 deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
87 deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
88 deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}