]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - .github/workflows/test.yml
Add github workflows
[github/Chocobozzz/PeerTube.git] / .github / workflows / test.yml
1 name: Test Suite
2
3 on: [push, pull_request]
4
5 jobs:
6
7 test:
8 runs-on: ubuntu-latest
9
10 services:
11 redis:
12 image: redis
13 ports:
14 - 6379:6379
15
16 postgres:
17 image: postgres:9.6
18 ports:
19 - 5432:5432
20 env:
21 POSTGRES_USER: peertube
22 POSTGRES_HOST_AUTH_METHOD: trust
23
24 strategy:
25 fail-fast: true
26 matrix:
27 test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint ]
28
29 env:
30 PGUSER: peertube
31 PGHOST: localhost
32
33 steps:
34 - uses: actions/checkout@v2
35
36 - name: Use Node.js
37 uses: actions/setup-node@v1
38 with:
39 node-version: '12.x'
40
41 - name: Setup system dependencies
42 run: |
43 sudo apt-get install postgresql-client-common redis-tools
44 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.0.3-64bit-static.tar.xz"
45 tar xf ffmpeg-release-4.0.3-64bit-static.tar.xz
46 mkdir -p $HOME/bin
47 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
48 echo "::add-path::$HOME/bin"
49
50 - name: Cache Node.js modules
51 uses: actions/cache@v2
52 with:
53 path: ~/.cache/yarn
54 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
55 restore-keys: |
56 ${{ runner.OS }}-node-
57 ${{ runner.OS }}-
58
59 - name: Install dependencies
60 run: yarn install --frozen-lockfile
61
62 - name: Test
63 run: echo $PATH
64
65 - name: Run Test
66 run: NODE_PENDING_JOB_WAIT=2000 npm run ci -- ${{ matrix.test_suite }}
67
68 - name: Upload logs
69 uses: actions/upload-artifact@v2
70 if: failure()
71 with:
72 name: test-storages
73 path: test*/logs