You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

performance.yml 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. name: Performance testing
  2. on:
  3. pull_request:
  4. jobs:
  5. performance-testing:
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. php-versions: ['8.0']
  11. name: performance-${{ matrix.php-versions }}
  12. steps:
  13. - name: Checkout server before PR
  14. uses: actions/checkout@v3
  15. with:
  16. submodules: true
  17. ref: ${{ github.event.pull_request.base.ref }}
  18. - name: Set up php ${{ matrix.php-versions }}
  19. uses: shivammathur/setup-php@v2
  20. with:
  21. php-version: ${{ matrix.php-versions }}
  22. tools: phpunit:9
  23. extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
  24. env:
  25. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  26. - name: Set up Nextcloud
  27. run: |
  28. mkdir data
  29. ./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
  30. php -S localhost:8080 &
  31. - name: Apply blueprint
  32. uses: icewind1991/blueprint@v0.1.2
  33. with:
  34. blueprint: tests/blueprints/basic.toml
  35. ref: ${{ github.event.pull_request.head.ref }}
  36. - name: Run before measurements
  37. uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d
  38. with:
  39. run: |
  40. curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
  41. curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
  42. curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
  43. curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
  44. curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
  45. output: before.json
  46. profiler-branch: master
  47. - name: Apply PR
  48. run: |
  49. git remote add pr ${{ github.event.pull_request.head.repo.clone_url }}
  50. git fetch pr ${{ github.event.pull_request.head.ref }}
  51. git checkout -b pr/${{ github.event.pull_request.head.ref }}
  52. git submodule update
  53. ./occ upgrade
  54. - name: Run after measurements
  55. id: compare
  56. uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d
  57. with:
  58. run: |
  59. curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
  60. curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
  61. curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
  62. curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
  63. curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
  64. output: after.json
  65. profiler-branch: master
  66. compare-with: before.json
  67. - name: Upload profiles
  68. if: always()
  69. uses: actions/upload-artifact@v2
  70. with:
  71. name: profiles
  72. path: |
  73. before.json
  74. after.json
  75. - uses: actions/github-script@v5
  76. if: failure() && steps.compare.outcome == 'failure'
  77. with:
  78. github-token: ${{secrets.GITHUB_TOKEN}}
  79. script: |
  80. let comment = `Possible performance regression detected\n`;
  81. comment += `<details><summary>Show Output</summary>
  82. \`\`\`
  83. ${{ steps.compare.outputs.compare }}
  84. \`\`\`
  85. </details>`;
  86. github.rest.issues.createComment({
  87. issue_number: context.issue.number,
  88. owner: context.repo.owner,
  89. repo: context.repo.repo,
  90. body: comment
  91. })