]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - .github/workflows/test.yml
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / .github / workflows / test.yml
CommitLineData
b202d007 1name: Test
b9fe9a7f 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:
0d22b7ad 22 image: postgres:10
b9fe9a7f
C
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 34 s3ninja:
1f6125be 35 image: chocobozzz/s3-ninja
0305db28
JB
36 ports:
37 - 9444:9000
38
b9fe9a7f 39 strategy:
b488ba1e 40 fail-fast: false
b9fe9a7f 41 matrix:
95faf1ea 42 test_suite: [ types-package, client, api-1, api-2, api-3, api-4, api-5, 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
9ab330b9
C
49 OBJECT_STORAGE_SCALEWAY_KEY_ID: ${{ secrets.OBJECT_STORAGE_SCALEWAY_KEY_ID }}
50 OBJECT_STORAGE_SCALEWAY_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SCALEWAY_ACCESS_KEY }}
0daaab0c 51 YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
b9fe9a7f
C
52
53 steps:
388a31d2 54 - uses: actions/checkout@v3
b9fe9a7f 55
51e9e152 56 - uses: './.github/actions/reusable-prepare-peertube-build'
b9fe9a7f 57 with:
902b16af 58 node-version: '16.x'
b9fe9a7f 59
51e9e152 60 - uses: './.github/actions/reusable-prepare-peertube-run'
b9fe9a7f 61
07491f4b 62 - name: Cache fixtures
388a31d2 63 uses: actions/cache@v3
07491f4b
C
64 with:
65 path: |
66 fixtures
67 key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }}
68 restore-keys: |
69 ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-
70 ${{ runner.OS }}-fixtures-
71 ${{ runner.OS }}-
72
f9d2deae 73 - name: Set env test variable (schedule)
a613eea4 74 if: github.event_name != 'schedule'
f9d2deae 75 run: |
79389bff 76 echo "DISABLE_HTTP_IMPORT_TESTS=true" >> $GITHUB_ENV
a613eea4 77
b9fe9a7f 78 - name: Run Test
f9e1ca70 79 # external-plugins tests only run on schedule
21609258 80 if: github.event_name == 'schedule' || matrix.test_suite != 'external-plugins'
36305301
C
81 env:
82 AKISMET_KEY: ${{ secrets.AKISMET_KEY }}
fae6e4da 83 run: npm run ci -- ${{ matrix.test_suite }}
b9fe9a7f 84
12554857 85 - name: Display errors
4f5a90ef 86 if: ${{ always() }}
0484ec9e 87 run: |
5ec8a71f
C
88 ( \
89 test -f dist/scripts/parse-log.js && \
5ec8a71f
C
90 NODE_ENV=test node dist/scripts/parse-log.js -l error -f artifacts/*.log \
91 ) || \
34caef7f 92 echo "parse-log.js script does not exist, skipping."
0484ec9e 93
b9fe9a7f 94 - name: Upload logs
8c13fd74 95 uses: actions/upload-artifact@v3
b9fe9a7f
C
96 if: failure()
97 with:
b488ba1e 98 name: test-storages-${{ matrix.test_suite }}
83ef31fe
C
99 path: artifacts
100 retention-days: 7