1
0

object-storage-azure.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. name: Object storage azure
  2. on:
  3. pull_request:
  4. schedule:
  5. - cron: "15 2 * * *"
  6. concurrency:
  7. group: object-storage-azure-${{ github.head_ref || github.run_id }}
  8. cancel-in-progress: true
  9. jobs:
  10. changes:
  11. runs-on: ubuntu-latest-low
  12. outputs:
  13. src: ${{ steps.changes.outputs.src}}
  14. steps:
  15. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  16. id: changes
  17. continue-on-error: true
  18. with:
  19. filters: |
  20. src:
  21. - '.github/workflows/**'
  22. - '3rdparty/**'
  23. - '**/appinfo/**'
  24. - '**/lib/**'
  25. - '**/templates/**'
  26. - '**/tests/**'
  27. - 'vendor/**'
  28. - 'vendor-bin/**'
  29. - '.php-cs-fixer.dist.php'
  30. - 'composer.json'
  31. - 'composer.lock'
  32. - '**.php'
  33. azure-primary-tests:
  34. runs-on: ubuntu-latest
  35. needs: changes
  36. if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.src != 'false' }}
  37. strategy:
  38. matrix:
  39. php-versions: ['8.1', '8.2', '8.3']
  40. include:
  41. - php-versions: '8.3'
  42. coverage: true
  43. name: php${{ matrix.php-versions }}-azure
  44. services:
  45. azurite:
  46. image: mcr.microsoft.com/azure-storage/azurite
  47. env:
  48. AZURITE_ACCOUNTS: nextcloud:bmV4dGNsb3Vk
  49. ports:
  50. - 10000:10000
  51. options: --health-cmd="nc 127.0.0.1 10000 -z" --health-interval=1s --health-retries=30
  52. cache:
  53. image: ghcr.io/nextcloud/continuous-integration-redis:latest
  54. ports:
  55. - 6379:6379/tcp
  56. options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
  57. steps:
  58. - name: Checkout server
  59. uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
  60. with:
  61. submodules: true
  62. - name: Set up php ${{ matrix.php-versions }}
  63. uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
  64. with:
  65. php-version: ${{ matrix.php-versions }}
  66. # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
  67. 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
  68. coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
  69. ini-file: development
  70. env:
  71. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  72. - name: Set up Nextcloud
  73. env:
  74. OBJECT_STORE: azure
  75. OBJECT_STORE_KEY: nextcloud
  76. OBJECT_STORE_SECRET: bmV4dGNsb3Vk
  77. run: |
  78. composer install
  79. cp tests/redis.config.php config/
  80. cp tests/preseed-config.php config/config.php
  81. ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
  82. php -f tests/enable_all.php | grep -i -C9999 error && echo "Error during app setup" && exit 1 || exit 0
  83. - name: PHPUnit
  84. env:
  85. OBJECT_STORE: azure
  86. OBJECT_STORE_KEY: nextcloud
  87. OBJECT_STORE_SECRET: bmV4dGNsb3Vk
  88. run: composer run test -- --group PRIMARY-azure ${{ matrix.coverage && ' --coverage-clover ./clover.xml' || '' }}
  89. - name: Upload code coverage
  90. if: ${{ !cancelled() && matrix.coverage }}
  91. uses: codecov/codecov-action@v4.1.1
  92. with:
  93. files: ./clover.xml
  94. flags: phpunit-azure
  95. - name: Azurite logs
  96. if: always()
  97. run: |
  98. docker ps -a
  99. docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
  100. azure-primary-summary:
  101. runs-on: ubuntu-latest-low
  102. needs: [changes, azure-primary-tests]
  103. if: always()
  104. steps:
  105. - name: Summary status
  106. run: if ${{ needs.changes.outputs.src != 'false' && needs.azure-primary-tests.result != 'success' }}; then exit 1; fi