123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- name: Performance testing
- on:
- pull_request:
- jobs:
- performance-testing:
- runs-on: ubuntu-latest
- if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
- strategy:
- fail-fast: false
- matrix:
- php-versions: ['8.0']
- name: performance-${{ matrix.php-versions }}
- steps:
- - name: Checkout server before PR
- uses: actions/checkout@v3
- with:
- submodules: true
- ref: ${{ github.event.pull_request.base.ref }}
- - name: Set up php ${{ matrix.php-versions }}
- uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2
- with:
- php-version: ${{ matrix.php-versions }}
- tools: phpunit:9
- extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Set up Nextcloud
- run: |
- mkdir data
- ./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
- php -S localhost:8080 &
- - name: Apply blueprint
- uses: icewind1991/blueprint@v0.1.2
- with:
- blueprint: tests/blueprints/basic.toml
- ref: ${{ github.event.pull_request.head.ref }}
- - name: Run before measurements
- uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d
- with:
- run: |
- curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
- curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
- curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
- curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
- curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
- output: before.json
- profiler-branch: master
- - name: Apply PR
- run: |
- git remote add pr ${{ github.event.pull_request.head.repo.clone_url }}
- git fetch pr ${{ github.event.pull_request.head.ref }}
- git checkout -b pr/${{ github.event.pull_request.head.ref }}
- git submodule update
- ./occ upgrade
- - name: Run after measurements
- id: compare
- uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d
- with:
- run: |
- curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test
- curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt
- curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files
- curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt
- curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt
- output: after.json
- profiler-branch: master
- compare-with: before.json
- - name: Upload profiles
- if: always()
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
- with:
- name: profiles
- path: |
- before.json
- after.json
- - uses: actions/github-script@v5
- if: failure() && steps.compare.outcome == 'failure'
- with:
- github-token: ${{secrets.GITHUB_TOKEN}}
- script: |
- let comment = `Possible performance regression detected\n`;
- comment += `<details><summary>Show Output</summary>
- \`\`\`
- ${{ steps.compare.outputs.compare }}
- \`\`\`
- </details>`;
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: comment
- })
|