test.yml 2.2 KB

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