]>
Commit | Line | Data |
---|---|---|
b9fe9a7f C |
1 | name: Test Suite |
2 | ||
a613eea4 C |
3 | on: |
4 | push: | |
5 | pull_request: | |
fc3b14e4 | 6 | types: [synchronize, opened] |
a613eea4 | 7 | schedule: |
f9e1ca70 | 8 | - cron: '0 3 * * 1-5' |
b9fe9a7f C |
9 | |
10 | jobs: | |
11 | ||
12 | test: | |
13 | runs-on: ubuntu-latest | |
14 | ||
15 | services: | |
16 | redis: | |
17 | image: redis | |
18 | ports: | |
19 | - 6379:6379 | |
20 | ||
21 | postgres: | |
22 | image: postgres:9.6 | |
23 | ports: | |
24 | - 5432:5432 | |
25 | env: | |
26 | POSTGRES_USER: peertube | |
27 | POSTGRES_HOST_AUTH_METHOD: trust | |
28 | ||
12e8547f | 29 | ldap: |
0158eeb0 | 30 | image: chocobozzz/docker-test-openldap |
12e8547f | 31 | ports: |
0158eeb0 | 32 | - 10389:10389 |
12e8547f | 33 | |
0305db28 JB |
34 | s3ninja: |
35 | image: scireum/s3-ninja | |
36 | ports: | |
37 | - 9444:9000 | |
38 | ||
b9fe9a7f | 39 | strategy: |
b488ba1e | 40 | fail-fast: false |
b9fe9a7f | 41 | matrix: |
29b7426c | 42 | test_suite: [ client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ] |
b9fe9a7f C |
43 | |
44 | env: | |
45 | PGUSER: peertube | |
46 | PGHOST: localhost | |
4b91bc15 | 47 | NODE_PENDING_JOB_WAIT: 250 |
0305db28 | 48 | ENABLE_OBJECT_STORAGE_TESTS: true |
b9fe9a7f C |
49 | |
50 | steps: | |
51 | - uses: actions/checkout@v2 | |
52 | ||
53 | - name: Use Node.js | |
54 | uses: actions/setup-node@v1 | |
55 | with: | |
56 | node-version: '12.x' | |
57 | ||
58 | - name: Setup system dependencies | |
59 | run: | | |
7abb5c5d | 60 | sudo apt-get install postgresql-client-common redis-tools parallel |
c655c9ef C |
61 | wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz" |
62 | tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz | |
b9fe9a7f C |
63 | mkdir -p $HOME/bin |
64 | cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin | |
79389bff | 65 | echo "$HOME/bin" >> $GITHUB_PATH |
b9fe9a7f C |
66 | |
67 | - name: Cache Node.js modules | |
68 | uses: actions/cache@v2 | |
69 | with: | |
b488ba1e C |
70 | path: | |
71 | **/node_modules | |
b9fe9a7f C |
72 | key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }} |
73 | restore-keys: | | |
74 | ${{ runner.OS }}-node- | |
75 | ${{ runner.OS }}- | |
76 | ||
07491f4b C |
77 | - name: Cache fixtures |
78 | uses: actions/cache@v2 | |
79 | with: | |
80 | path: | | |
81 | fixtures | |
82 | key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }} | |
83 | restore-keys: | | |
84 | ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}- | |
85 | ${{ runner.OS }}-fixtures- | |
86 | ${{ runner.OS }}- | |
87 | ||
b9fe9a7f C |
88 | - name: Install dependencies |
89 | run: yarn install --frozen-lockfile | |
90 | ||
f9d2deae | 91 | - name: Set env test variable (schedule) |
a613eea4 | 92 | if: github.event_name != 'schedule' |
f9d2deae | 93 | run: | |
79389bff | 94 | echo "DISABLE_HTTP_IMPORT_TESTS=true" >> $GITHUB_ENV |
a613eea4 | 95 | |
b9fe9a7f | 96 | - name: Run Test |
f9e1ca70 C |
97 | # external-plugins tests only run on schedule |
98 | if: github.event_name == 'schedule' || matrix.test_suite != 'external-plugins' | |
fae6e4da | 99 | run: npm run ci -- ${{ matrix.test_suite }} |
b9fe9a7f | 100 | |
12554857 | 101 | - name: Display errors |
4f5a90ef | 102 | if: ${{ always() }} |
0484ec9e | 103 | run: | |
5ec8a71f C |
104 | ( \ |
105 | test -f dist/scripts/parse-log.js && \ | |
106 | cat *-ci.log | uniq -c && \ | |
107 | NODE_ENV=test node dist/scripts/parse-log.js -l error -f artifacts/*.log \ | |
108 | ) || \ | |
34caef7f | 109 | echo "parse-log.js script does not exist, skipping." |
0484ec9e | 110 | |
b9fe9a7f C |
111 | - name: Upload logs |
112 | uses: actions/upload-artifact@v2 | |
113 | if: failure() | |
114 | with: | |
b488ba1e | 115 | name: test-storages-${{ matrix.test_suite }} |
83ef31fe C |
116 | path: artifacts |
117 | retention-days: 7 |