[WIP] WASM: use static attribute parsers #2419
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 tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| # Abort if new commit since then | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| perf-tests: | |
| if: | |
| ${{ !contains(github.event.pull_request.labels.*.name, 'skip-performance-checks') }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22.x] | |
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| - name: Linux package installation | |
| run: | | |
| # needed for integration & memory tests codecs support | |
| sudo add-apt-repository multiverse && sudo apt update && sudo apt install -y \ | |
| ubuntu-restricted-extras | |
| - name: Install JS dependencies | |
| run: npm ci | |
| - name: Select performance suites | |
| run: | | |
| suites="tests/performance/src/suites/general.js" | |
| changed_files="$(git diff --name-only \ | |
| "${{ github.event.pull_request.base.sha }}" \ | |
| "${{ github.event.pull_request.head.sha }}")" | |
| if grep -Eq \ | |
| '^(src/parsers/manifest/dash/|tests/performance/|tests/contents/|scripts/|package\.json$|package-lock\.json$|\.github/workflows/perfs\.yml$)' \ | |
| <<< "$changed_files" | |
| then | |
| suites="$suites tests/performance/src/suites/dash_parsers.js" | |
| fi | |
| echo "PERFORMANCE_SUITES=$suites" >> "$GITHUB_ENV" | |
| - name: Run performance tests | |
| run: | | |
| export DISPLAY=:99 | |
| sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
| npm run test:performance -- --branch $GITHUB_BASE_REF \ | |
| --remote-git-url https://github.com/canalplus/rx-player.git \ | |
| --report perf-report.md \ | |
| $PERFORMANCE_SUITES | |
| - name: Post comment | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { readFileSync, existsSync } = require('fs'); | |
| if (!existsSync("./perf-report.md")) { | |
| return; | |
| } | |
| const fileContent = readFileSync("./perf-report.md").toString(); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| // TODO: generate comment header inside the report file instead of here for better portability? | |
| // We should already have access to the sha1 through `git` and the destination branch through the command line arguments. | |
| body: fileContent, | |
| }) |