]>
Commit | Line | Data |
---|---|---|
b9fe9a7f C |
1 | name: Test Suite |
2 | ||
a613eea4 C |
3 | on: |
4 | push: | |
fc3b14e4 C |
5 | branches: |
6 | - develop | |
7 | - master | |
a613eea4 | 8 | pull_request: |
fc3b14e4 | 9 | types: [synchronize, opened] |
a613eea4 | 10 | schedule: |
f9e1ca70 | 11 | - cron: '0 3 * * 1-5' |
b9fe9a7f C |
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 | ||
12e8547f | 32 | ldap: |
0158eeb0 | 33 | image: chocobozzz/docker-test-openldap |
12e8547f | 34 | ports: |
0158eeb0 | 35 | - 10389:10389 |
12e8547f | 36 | |
b9fe9a7f | 37 | strategy: |
b488ba1e | 38 | fail-fast: false |
b9fe9a7f | 39 | matrix: |
12e8547f | 40 | test_suite: [ misc, api-1, api-2, api-3, api-4, cli, lint, external-plugins ] |
b9fe9a7f C |
41 | |
42 | env: | |
43 | PGUSER: peertube | |
44 | PGHOST: localhost | |
b488ba1e | 45 | NODE_PENDING_JOB_WAIT: 2000 |
b9fe9a7f C |
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: | | |
7abb5c5d | 57 | sudo apt-get install postgresql-client-common redis-tools parallel |
c655c9ef C |
58 | wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz" |
59 | tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz | |
b9fe9a7f C |
60 | mkdir -p $HOME/bin |
61 | cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin | |
79389bff | 62 | echo "$HOME/bin" >> $GITHUB_PATH |
b9fe9a7f C |
63 | |
64 | - name: Cache Node.js modules | |
65 | uses: actions/cache@v2 | |
66 | with: | |
b488ba1e C |
67 | path: | |
68 | **/node_modules | |
b9fe9a7f C |
69 | key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }} |
70 | restore-keys: | | |
71 | ${{ runner.OS }}-node- | |
72 | ${{ runner.OS }}- | |
73 | ||
07491f4b C |
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 | ||
b9fe9a7f C |
85 | - name: Install dependencies |
86 | run: yarn install --frozen-lockfile | |
87 | ||
f9d2deae | 88 | - name: Set env test variable (schedule) |
a613eea4 | 89 | if: github.event_name != 'schedule' |
f9d2deae | 90 | run: | |
79389bff | 91 | echo "DISABLE_HTTP_IMPORT_TESTS=true" >> $GITHUB_ENV |
a613eea4 | 92 | |
b9fe9a7f | 93 | - name: Run Test |
f9e1ca70 C |
94 | # external-plugins tests only run on schedule |
95 | if: github.event_name == 'schedule' || matrix.test_suite != 'external-plugins' | |
b9fe9a7f C |
96 | run: NODE_PENDING_JOB_WAIT=2000 npm run ci -- ${{ matrix.test_suite }} |
97 | ||
12554857 | 98 | - name: Display errors |
4f5a90ef | 99 | if: ${{ always() }} |
0484ec9e | 100 | run: | |
5ec8a71f C |
101 | ( \ |
102 | test -f dist/scripts/parse-log.js && \ | |
103 | cat *-ci.log | uniq -c && \ | |
104 | NODE_ENV=test node dist/scripts/parse-log.js -l error -f artifacts/*.log \ | |
105 | ) || \ | |
34caef7f | 106 | echo "parse-log.js script does not exist, skipping." |
0484ec9e | 107 | |
b9fe9a7f C |
108 | - name: Upload logs |
109 | uses: actions/upload-artifact@v2 | |
110 | if: failure() | |
111 | with: | |
b488ba1e | 112 | name: test-storages-${{ matrix.test_suite }} |
83ef31fe C |
113 | path: artifacts |
114 | retention-days: 7 |