]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - .github/workflows/test.yml
9c90e64379b9b516da292838884bdfb874fcff3f
[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 ldap:
25 image: rroemhild/test-openldap
26 ports:
27 - 389:389
28
29 strategy:
30 fail-fast: false
31 matrix:
32 test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint, external-plugins ]
33
34 env:
35 PGUSER: peertube
36 PGHOST: localhost
37 DISABLE_HTTP_IMPORT_TESTS: true
38 NODE_PENDING_JOB_WAIT: 2000
39
40 steps:
41 - uses: actions/checkout@v2
42
43 - name: Use Node.js
44 uses: actions/setup-node@v1
45 with:
46 node-version: '12.x'
47
48 - name: Setup system dependencies
49 run: |
50 sudo apt-get install postgresql-client-common redis-tools parallel
51 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.0.3-64bit-static.tar.xz"
52 tar xf ffmpeg-release-4.0.3-64bit-static.tar.xz
53 mkdir -p $HOME/bin
54 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
55 echo "::add-path::$HOME/bin"
56
57 - name: Cache Node.js modules
58 uses: actions/cache@v2
59 with:
60 path: |
61 **/node_modules
62 ~/fixtures
63 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
64 restore-keys: |
65 ${{ runner.OS }}-node-
66 ${{ runner.OS }}-
67
68 - name: Install dependencies
69 run: yarn install --frozen-lockfile
70
71 - name: Run Test
72 run: NODE_PENDING_JOB_WAIT=2000 npm run ci -- ${{ matrix.test_suite }}
73
74 - name: Upload logs
75 uses: actions/upload-artifact@v2
76 if: failure()
77 with:
78 name: test-storages-${{ matrix.test_suite }}
79 path: test*/logs