]>
Commit | Line | Data |
---|---|---|
b9fe9a7f C |
1 | name: Test Suite |
2 | ||
a613eea4 C |
3 | on: |
4 | push: | |
5 | pull_request: | |
6 | schedule: | |
7 | - cron: '0 0 * * 1-5' | |
b9fe9a7f C |
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 | ||
12e8547f C |
28 | ldap: |
29 | image: rroemhild/test-openldap | |
30 | ports: | |
31 | - 389:389 | |
32 | ||
b9fe9a7f | 33 | strategy: |
b488ba1e | 34 | fail-fast: false |
b9fe9a7f | 35 | matrix: |
12e8547f | 36 | test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint, external-plugins ] |
b9fe9a7f C |
37 | |
38 | env: | |
39 | PGUSER: peertube | |
40 | PGHOST: localhost | |
b488ba1e | 41 | NODE_PENDING_JOB_WAIT: 2000 |
b9fe9a7f C |
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: | | |
7abb5c5d | 53 | sudo apt-get install postgresql-client-common redis-tools parallel |
b9fe9a7f C |
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: | |
b488ba1e C |
63 | path: | |
64 | **/node_modules | |
65 | ~/fixtures | |
b9fe9a7f C |
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 | ||
a613eea4 C |
74 | - name: Set videos import enabled env variable |
75 | if: github.event_name != 'schedule' | |
76 | run: echo "::set-env name=DISABLE_HTTP_IMPORT_TESTS::true" | |
77 | ||
b9fe9a7f C |
78 | - name: Run Test |
79 | run: NODE_PENDING_JOB_WAIT=2000 npm run ci -- ${{ matrix.test_suite }} | |
80 | ||
81 | - name: Upload logs | |
82 | uses: actions/upload-artifact@v2 | |
83 | if: failure() | |
84 | with: | |
b488ba1e | 85 | name: test-storages-${{ matrix.test_suite }} |
b9fe9a7f | 86 | path: test*/logs |