1
0

phpunit-sqlite.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. name: PHPUnit sqlite
  6. on:
  7. pull_request:
  8. schedule:
  9. - cron: "5 2 * * *"
  10. permissions:
  11. contents: read
  12. concurrency:
  13. group: phpunit-sqlite-${{ github.head_ref || github.run_id }}
  14. cancel-in-progress: true
  15. jobs:
  16. changes:
  17. runs-on: ubuntu-latest-low
  18. outputs:
  19. src: ${{ steps.changes.outputs.src }}
  20. steps:
  21. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  22. id: changes
  23. continue-on-error: true
  24. with:
  25. filters: |
  26. src:
  27. - '.github/workflows/**'
  28. - '3rdparty/**'
  29. - '**/appinfo/**'
  30. - '**/lib/**'
  31. - '**/templates/**'
  32. - '**/tests/**'
  33. - 'vendor/**'
  34. - 'vendor-bin/**'
  35. - '.php-cs-fixer.dist.php'
  36. - 'composer.json'
  37. - 'composer.lock'
  38. - '**.php'
  39. phpunit-sqlite:
  40. runs-on: ubuntu-latest
  41. needs: changes
  42. if: needs.changes.outputs.src != 'false'
  43. strategy:
  44. matrix:
  45. php-versions: ['8.1', '8.2', '8.3']
  46. include:
  47. - php-versions: '8.1'
  48. coverage: ${{ github.event_name != 'pull_request' }}
  49. name: SQLite (PHP ${{ matrix.php-versions }})
  50. services:
  51. cache:
  52. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  53. ports:
  54. - 6379:6379/tcp
  55. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  56. steps:
  57. - name: Checkout server
  58. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
  59. with:
  60. submodules: true
  61. - name: Set up php ${{ matrix.php-versions }}
  62. uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # v2
  63. with:
  64. php-version: ${{ matrix.php-versions }}
  65. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  66. extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
  67. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  68. ini-file: development
  69. env:
  70. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  71. - name: Set up dependencies
  72. run: composer i
  73. - name: Set up Nextcloud
  74. run: |
  75. mkdir data
  76. cp tests/redis.config.php config/
  77. cp tests/preseed-config.php config/config.php
  78. ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
  79. php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
  80. - name: Nextcloud debug information
  81. run: ./occ app:list && echo "======= System config =======" && ./occ config:list system
  82. - name: PHPUnit database tests
  83. run: composer run test:db ${{ matrix.coverage && ' -- --coverage-clover ./clover.db.xml' || '' }}
  84. - name: Upload db code coverage
  85. if: ${{ !cancelled() && matrix.coverage }}
  86. uses: codecov/codecov-action@v4.1.1
  87. with:
  88. files: ./clover.db.xml
  89. flags: phpunit-sqlite
  90. - name: Print logs
  91. if: always()
  92. run: |
  93. cat data/nextcloud.log
  94. summary:
  95. permissions:
  96. contents: none
  97. runs-on: ubuntu-latest-low
  98. needs: [changes, phpunit-sqlite]
  99. if: always()
  100. name: phpunit-sqlite-summary
  101. steps:
  102. - name: Summary status
  103. run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi