mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The floors step piped scripts/mutation-floors.mjs into tee without pipefail, so it took tee's exit status and a module under its floor could never fail the run. It now runs under bash with pipefail, as do the other steps that pipe into tee, and a guard reads every workflow and fails on a tee pipe without it. The other piped steps were checked: each either validates what the pipe produced or pipes a command that cannot fail. The nightly runs set FC_NUM_RUNS, an absolute count that replaced every property's own: the database backup round trip, which states twelve cases for its cost, ran a hundred times against a timeout sized for twelve. FC_RUNS_FACTOR now multiplies each property's count (five for the unit suite, four for integration), propertyTimeout grows a test's timeout by the same factor, and the backup round trip uses it.
54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: Mutation tests
|
|
|
|
# Stryker on the core libraries (stryker.config.mjs): encryption at rest,
|
|
# medication compliance, rollups, source ranking, unit conversion and backup
|
|
# validation. Too slow for a pull request; it runs once a night and on
|
|
# demand, and fails when a module's score drops below its floor in
|
|
# stryker.floors.json. The HTML report is uploaded either way.
|
|
on:
|
|
schedule:
|
|
- cron: "23 1 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
mutation:
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 120
|
|
name: mutation (core libraries)
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
|
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
- run: pnpm db:generate
|
|
|
|
- name: Run Stryker
|
|
run: pnpm exec stryker run --concurrency 4
|
|
|
|
# Without pipefail the step takes the exit status of `tee`, which is
|
|
# always 0, so a module under its floor could never fail the run.
|
|
- name: Check the per-module floors
|
|
shell: bash
|
|
run: |
|
|
set -o pipefail
|
|
node scripts/mutation-floors.mjs | tee -a "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Upload the report
|
|
if: always()
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: mutation-report
|
|
path: reports/mutation/
|
|
if-no-files-found: ignore
|
|
retention-days: 30
|