fix(results): keep the grid mounted across a run #630
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: CI | |
| # Run the test suites on every PR into dev or main so nothing merges red. | |
| on: | |
| pull_request: | |
| branches: [dev, main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| frontend: | |
| name: frontend | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: i18n catalog check | |
| run: npm run i18n:check | |
| - name: Type-check & build | |
| run: npm run build | |
| - name: Unit tests with coverage | |
| run: npm run coverage:frontend | |
| - name: Frontend coverage summary | |
| run: | | |
| node <<'NODE' | |
| const fs = require('fs'); | |
| const summary = JSON.parse(fs.readFileSync('coverage/frontend/coverage-summary.json', 'utf8')).total; | |
| const rows = ['lines', 'statements', 'functions', 'branches'] | |
| .map((key) => `| ${key} | ${summary[key].pct}% | ${summary[key].covered}/${summary[key].total} |`) | |
| .join('\n'); | |
| fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, `## Frontend coverage\n\n| Metric | Coverage | Covered |\n|---|---:|---:|\n${rows}\n`); | |
| NODE | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: frontend-coverage | |
| path: coverage/frontend | |
| backend: | |
| name: backend | |
| runs-on: ubuntu-22.04 | |
| # A real MongoDB so the integration tests can exercise the live query/aggregate/ | |
| # DDL/document/export/GridFS/schema paths (the bulk of the backend). Without it | |
| # those tests no-op and coverage drops well below the gate below. | |
| services: | |
| mongodb: | |
| image: mongo:7 | |
| ports: | |
| - 27017:27017 | |
| options: >- | |
| --health-cmd "mongosh --quiet --eval 'db.runCommand({ ping: 1 }).ok'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| # Integration tests read this; when unset they skip (keeps `cargo test` green offline). | |
| MQLENS_TEST_MONGO_URI: mongodb://localhost:27017 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| # The Tauri lib + gssapi-auth feature need these system libs to compile. | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libjavascriptcoregtk-4.1-dev \ | |
| libappindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| libgtk-3-dev \ | |
| libssl-dev \ | |
| libkrb5-dev \ | |
| clang \ | |
| libclang-dev \ | |
| build-essential | |
| # Pinned to the head of the action's `stable` branch. That branch name was | |
| # never magic: the action reads `inputs.toolchain`, whose default differs | |
| # per branch, and never looks at the ref it was called by — so the | |
| # toolchain is stated here instead of being implied by the ref. | |
| - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable branch | |
| with: | |
| toolchain: stable | |
| # Same shape: the `cargo-llvm-cov` tag only sets `inputs.tool`'s default. | |
| - uses: taiki-e/install-action@419f0f955ea0cf384c06ae25b10b8d3bcba087da # cargo-llvm-cov tag | |
| with: | |
| tool: cargo-llvm-cov | |
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| workspaces: src-tauri | |
| - name: Backend tests with coverage | |
| # Fail the build if line coverage drops below 70% (the agreed target floor). | |
| run: cargo llvm-cov --manifest-path src-tauri/Cargo.toml --summary-only --fail-under-lines 70 --ignore-filename-regex 'src-tauri/src/(lib|main)\.rs' |