perf(web): optimize PWA startup #910
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
| # For most projects, this workflow file will not need changing; you simply need | |
| # to commit it to your repository. | |
| # | |
| # You may wish to alter this file to override the set of languages analyzed, | |
| # or to provide custom queries or build logic. | |
| name: "CodeQL" | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 16 * * 6" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: ["cpp"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4.37.7 | |
| with: | |
| languages: ${{ matrix.language }} | |
| # Build the project using PlatformIO | |
| - name: Set up PlatformIO | |
| uses: ./.github/actions/setup-platformio | |
| with: | |
| python-version: "3.11" | |
| - name: Run PlatformIO | |
| run: platformio run | |
| # NOTE: For compiled languages (cpp), `paths-ignore` in a CodeQL config | |
| # file does NOT exclude third-party build dependencies — the build | |
| # tracer extracts everything the compiler touches (including | |
| # .pio/libdeps/), regardless of config-level path filters. See | |
| # https://docs.github.com/en/code-security/reference/code-scanning/troubleshoot-analysis-errors/alerts-in-generated-code | |
| # The reliable fix is to post-process the SARIF and strip results | |
| # under .pio/libdeps/ before uploading. | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4.37.7 | |
| with: | |
| output: sarif-results | |
| upload: never | |
| - name: Filter out .pio/libdeps alerts from SARIF | |
| run: | | |
| set -euo pipefail | |
| for f in sarif-results/*.sarif; do | |
| jq '.runs[].results |= map(select( | |
| (.locations[0].physicalLocation.artifactLocation.uri // "") | |
| | startswith(".pio/libdeps/") | not | |
| ))' "$f" > "$f.filtered" | |
| mv "$f.filtered" "$f" | |
| done | |
| - name: Upload CodeQL results | |
| uses: github/codeql-action/upload-sarif@v4.37.7 | |
| with: | |
| sarif_file: sarif-results |