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