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