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