|
| 1 | +name: Build and run performance tests for PR |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + types: |
| 7 | + - labeled |
| 8 | + |
| 9 | +jobs: |
| 10 | + |
| 11 | + # TODO: switch to dedicated runner workflow |
| 12 | + pr-perf-test-run: |
| 13 | + # We only need to test this once as the rest are chained from it. |
| 14 | + if: contains(github.event.pull_request.labels.*.name, 'ok-to-performance-test') |
| 15 | + name: Run performance tests for PR |
| 16 | + runs-on: ubuntu-20.04 |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + sudo apt update |
| 23 | + sudo apt-get install -y jq |
| 24 | +
|
| 25 | + # Install docker-compose |
| 26 | + # Later versions have an SSL issue on this OS for remote repository builds |
| 27 | + sudo curl --fail --silent -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose |
| 28 | + sudo chmod a+x /usr/local/bin/docker-compose |
| 29 | +
|
| 30 | + # Add promplot |
| 31 | + curl --fail --silent -L https://github.com/qvl/promplot/releases/download/v0.17.0/promplot_0.17.0_linux_64bit.tar.gz| tar -xz |
| 32 | + chmod a+x ./promplot |
| 33 | + sudo mv -vf ./promplot /usr/local/bin/promplot |
| 34 | + shell: bash |
| 35 | + |
| 36 | + - name: Run the tests on this runner |
| 37 | + timeout-minutes: 45 |
| 38 | + run: | |
| 39 | + curl -L https://raw.githubusercontent.com/fluent/fluent-bit-ci/master/scripts/docker-compose-monitor.sh | bash |
| 40 | + shell: bash |
| 41 | + env: |
| 42 | + TEST_DIRECTORY: ./examples/perf-test |
| 43 | + SERVICE_TO_MONITOR: fb-delta |
| 44 | + RUN_TIMEOUT_MINUTES: 30 |
| 45 | + |
| 46 | + - name: Upload any results |
| 47 | + if: always() |
| 48 | + uses: actions/upload-artifact@v3 |
| 49 | + with: |
| 50 | + name: output |
| 51 | + path: output/ |
| 52 | + |
| 53 | + pr-perf-test-complete: |
| 54 | + name: PR - performance test complete |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: |
| 57 | + - pr-perf-test-run |
| 58 | + steps: |
| 59 | + # TODO: post results as well |
| 60 | + - uses: actions-ecosystem/action-add-labels@v1 |
| 61 | + name: Label the PR |
| 62 | + with: |
| 63 | + labels: ci/performance-test-ok |
| 64 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + number: ${{ github.event.pull_request.number }} |
0 commit comments