]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .github/workflows/test.yml
Merge branch 'release/3.3.0' into develop
[github/Chocobozzz/PeerTube.git] / .github / workflows / test.yml
CommitLineData
b9fe9a7f
C
1name: Test Suite
2
a613eea4
C
3on:
4 push:
5 pull_request:
fc3b14e4 6 types: [synchronize, opened]
a613eea4 7 schedule:
f9e1ca70 8 - cron: '0 3 * * 1-5'
b9fe9a7f
C
9
10jobs:
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
b9fe9a7f 34 strategy:
b488ba1e 35 fail-fast: false
b9fe9a7f 36 matrix:
29b7426c 37 test_suite: [ client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ]
b9fe9a7f
C
38
39 env:
40 PGUSER: peertube
41 PGHOST: localhost
4b91bc15 42 NODE_PENDING_JOB_WAIT: 250
b9fe9a7f
C
43
44 steps:
45 - uses: actions/checkout@v2
46
47 - name: Use Node.js
48 uses: actions/setup-node@v1
49 with:
50 node-version: '12.x'
51
52 - name: Setup system dependencies
53 run: |
7abb5c5d 54 sudo apt-get install postgresql-client-common redis-tools parallel
c655c9ef
C
55 wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
56 tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
b9fe9a7f
C
57 mkdir -p $HOME/bin
58 cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
79389bff 59 echo "$HOME/bin" >> $GITHUB_PATH
b9fe9a7f
C
60
61 - name: Cache Node.js modules
62 uses: actions/cache@v2
63 with:
b488ba1e
C
64 path: |
65 **/node_modules
b9fe9a7f
C
66 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
67 restore-keys: |
68 ${{ runner.OS }}-node-
69 ${{ runner.OS }}-
70
07491f4b
C
71 - name: Cache fixtures
72 uses: actions/cache@v2
73 with:
74 path: |
75 fixtures
76 key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }}
77 restore-keys: |
78 ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-
79 ${{ runner.OS }}-fixtures-
80 ${{ runner.OS }}-
81
b9fe9a7f
C
82 - name: Install dependencies
83 run: yarn install --frozen-lockfile
84
f9d2deae 85 - name: Set env test variable (schedule)
a613eea4 86 if: github.event_name != 'schedule'
f9d2deae 87 run: |
79389bff 88 echo "DISABLE_HTTP_IMPORT_TESTS=true" >> $GITHUB_ENV
a613eea4 89
b9fe9a7f 90 - name: Run Test
f9e1ca70
C
91 # external-plugins tests only run on schedule
92 if: github.event_name == 'schedule' || matrix.test_suite != 'external-plugins'
fae6e4da 93 run: npm run ci -- ${{ matrix.test_suite }}
b9fe9a7f 94
12554857 95 - name: Display errors
4f5a90ef 96 if: ${{ always() }}
0484ec9e 97 run: |
5ec8a71f
C
98 ( \
99 test -f dist/scripts/parse-log.js && \
100 cat *-ci.log | uniq -c && \
101 NODE_ENV=test node dist/scripts/parse-log.js -l error -f artifacts/*.log \
102 ) || \
34caef7f 103 echo "parse-log.js script does not exist, skipping."
0484ec9e 104
b9fe9a7f
C
105 - name: Upload logs
106 uses: actions/upload-artifact@v2
107 if: failure()
108 with:
b488ba1e 109 name: test-storages-${{ matrix.test_suite }}
83ef31fe
C
110 path: artifacts
111 retention-days: 7