refine(otaproxy): allow otaproxy to run even if sqlite3 DB init failed #809
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Performance Test | |
| permissions: | |
| contents: read | |
| packages: read | |
| actions: read | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - v* | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| jobs: | |
| performance_test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout commit | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Create test_result directory | |
| run: mkdir -p test_result | |
| - name: Run performance tests | |
| run: | | |
| docker compose -f docker/test_base/docker-compose_tests_py313.yml run --rm tester-ubuntu-22.04 \ | |
| tests/test_otaclient/test_performance/test_e2e_performance.py -v -s | |
| - name: Check if performance report exists | |
| id: check_report | |
| run: | | |
| if [ -f test_result/performance_comparison.md ]; then | |
| echo "report_exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "report_exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Post performance report to PR | |
| if: steps.check_report.outputs.report_exists == 'true' && github.event_name == 'pull_request' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const reportPath = 'test_result/performance_comparison.md'; | |
| const reportContent = fs.readFileSync(reportPath, 'utf8'); | |
| // Find existing comment | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes('📊 OTA Update Performance Comparison Report') | |
| ); | |
| const commentBody = `<!-- performance-report -->\n${reportContent}`; | |
| if (botComment) { | |
| // Update existing comment | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: botComment.id, | |
| body: commentBody | |
| }); | |
| console.log('Updated existing performance report comment'); | |
| } else { | |
| // Create new comment | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: commentBody | |
| }); | |
| console.log('Created new performance report comment'); | |
| } | |
| - name: Upload performance report artifact | |
| if: steps.check_report.outputs.report_exists == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: performance-report | |
| path: test_result/performance_comparison.md |