From 0cf10613f2be696afc5ce3f79b77c2845bb1709c Mon Sep 17 00:00:00 2001 From: Matysh Date: Fri, 14 Aug 2026 15:08:31 +0300 Subject: [PATCH] ci: mutation-gate must live on the default branch to be dispatchable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gh workflow run answered 404: workflow_dispatch and schedule both resolve the workflow file against the default branch, and the file sat only in dev. The same trap as the process pipeline — even documented in that file's header — and still stepped in a second time. The job itself checks out dev, so running from main tests exactly the code it should. Issue: #85 User-Visible: no --- .github/workflows/mutation-gate.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/mutation-gate.yml diff --git a/.github/workflows/mutation-gate.yml b/.github/workflows/mutation-gate.yml new file mode 100644 index 00000000..26491f73 --- /dev/null +++ b/.github/workflows/mutation-gate.yml @@ -0,0 +1,61 @@ +name: Mutation gate + +# Реестр известных поломок (issue #85): каждый мутант ломает продуктовый код +# известным способом, и объявленный тест ОБЯЗАН на этом покраснеть. Тест, +# оставшийся зелёным на сломанном коде, ничего не защищает — он лишь выглядит +# защитой, и это хуже его отсутствия. +# +# Прогон дорогой: пересборка бандла на каждого мутанта. Поэтому он не входит в +# Validate и не идёт на каждый push. Его место — перед стабильным релизом +# (PROCESS.md §8) и раз в неделю по расписанию, чтобы дрейф тестов не копился +# до релиза. Дешёвая половина — «якоря патчей живы, guard-файлы существуют» — +# идёт с обычными юнитами: test/mutation-gate.test.mjs. + +on: + workflow_dispatch: + schedule: + # Понедельник, 05:20 UTC — до начала рабочего дня владельца. + - cron: '20 5 * * 1' + +permissions: + contents: read + +concurrency: + group: mutation-gate + cancel-in-progress: true + +jobs: + mutants: + runs-on: ubuntu-latest + # Шесть мутантов × (сборка + браузерный смок) — это десятки минут, и это + # нормально: гейт предрелизный. Час — потолок против зависшего Chromium. + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + with: + ref: dev + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + + - name: Кэш браузеров Playwright + id: pw + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + + - name: Установить Chromium + if: steps.pw.outputs.cache-hit != 'true' + run: npx playwright install --with-deps chromium + + - name: Реестр применим к текущему коду + run: node scripts/mutation-gate.mjs --check + + - name: Каждый тест ловит свою поломку + run: node scripts/mutation-gate.mjs