13 runs-on: ubuntu-latest
26 POSTGRES_USER: peertube
27 POSTGRES_HOST_AUTH_METHOD: trust
32 NODE_PENDING_JOB_WAIT: 500
35 - uses: actions/checkout@v2
38 uses: actions/setup-node@v1
42 - name: Setup system dependencies
44 sudo apt-get install postgresql-client-common redis-tools parallel
45 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
46 tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
48 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
49 echo "$HOME/bin" >> $GITHUB_PATH
51 - name: Cache Node.js modules
52 uses: actions/cache@v2
56 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
58 ${{ runner.OS }}-node-
61 - name: Cache fixtures
62 uses: actions/cache@v2
66 key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }}
68 ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-
69 ${{ runner.OS }}-fixtures-
72 - name: Install dependencies
73 run: yarn install --frozen-lockfile
77 startClient=`date +%s`
80 clientBuildTime=$((endClient-startClient))
82 startServer=`date +%s`
85 serverBuildTime=$((endServer-startServer))
87 echo '{"clientBuildTime":'$clientBuildTime',"serverBuildTime":'$serverBuildTime'}'> build-time.json
91 node dist/scripts/benchmark.js benchmark.json
93 - name: Display result
95 cat benchmark.json build-time.json
97 - name: Upload benchmark result
99 STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
100 STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
101 STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }}
102 STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
106 if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
107 echo "Adding ssh key to known hosts"
108 echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
113 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
114 echo "Adding ssh reployement key"
115 ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
118 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
119 echo "Uploading files"
120 scp benchmark.json build-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;