diff --git a/.github/workflows/ci-data-sanitization-log-providers.yml b/.github/workflows/ci-data-sanitization-log-providers.yml new file mode 100644 index 0000000..982fa56 --- /dev/null +++ b/.github/workflows/ci-data-sanitization-log-providers.yml @@ -0,0 +1,90 @@ +name: CI (data-sanitization-log-providers) + +on: + push: + branches: [main] + paths: + - 'packages/data-sanitization-log-providers/**' + - 'packages/data-sanitization/**' + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - '.oxlintrc.json' + - '.oxfmtrc.json' + - '.github/workflows/ci-data-sanitization-log-providers.yml' + pull_request: + branches: [main] + paths: + - 'packages/data-sanitization-log-providers/**' + - 'packages/data-sanitization/**' + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - '.oxlintrc.json' + - '.oxfmtrc.json' + - '.github/workflows/ci-data-sanitization-log-providers.yml' + +jobs: + ci: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + strategy: + fail-fast: false + matrix: + node-version: [22, 24] + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - run: corepack enable + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - run: | + git config --global user.name "CI" + git config --global user.email "ci@localhost" + git config --global init.defaultBranch main + - run: yarn install --immutable + - run: yarn workspace data-sanitization build + - run: yarn workspace data-sanitization-log-providers format:check + - run: yarn workspace data-sanitization-log-providers lint:ci + - run: yarn workspace data-sanitization-log-providers build + - run: yarn workspace data-sanitization-log-providers test:coverage + - name: Report coverage + if: matrix.node-version == 24 + uses: davelosert/vitest-coverage-report-action@02f3c2e641286b7fa308cd3e430783103ce6103b # v2 + with: + json-summary-path: coverage/coverage-summary.json + json-final-path: coverage/coverage-final.json + working-directory: packages/data-sanitization-log-providers + - name: Extract coverage percentage + id: coverage + if: matrix.node-version == 24 && github.event_name == 'push' + run: echo "percentage=$(jq '.total.lines.pct' packages/data-sanitization-log-providers/coverage/coverage-summary.json)" >> "$GITHUB_OUTPUT" + - name: Update coverage badge + if: matrix.node-version == 24 && github.event_name == 'push' + uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0 + with: + auth: ${{ secrets.GIST_SECRET }} + gistID: ${{ vars.COVERAGE_GIST_ID }} + filename: data-sanitization-log-providers-coverage-badge-config.json + label: coverage + message: ${{ steps.coverage.outputs.percentage }}% + valColorRange: ${{ steps.coverage.outputs.percentage }} + maxColorRange: 100 + minColorRange: 0 + - name: Update coverage report in Gist + if: matrix.node-version == 24 && github.event_name == 'push' + env: + COVERAGE_GIST_ID: ${{ vars.COVERAGE_GIST_ID }} + GIST_SECRET: ${{ secrets.GIST_SECRET }} + run: yarn workspace data-sanitization-log-providers node ../data-sanitization/scripts/update-coverage-gist.mjs --package-name data-sanitization-log-providers diff --git a/.github/workflows/ci-data-sanitization.yml b/.github/workflows/ci-data-sanitization.yml new file mode 100644 index 0000000..7cac2dd --- /dev/null +++ b/.github/workflows/ci-data-sanitization.yml @@ -0,0 +1,87 @@ +name: CI (data-sanitization) + +on: + push: + branches: [main] + paths: + - 'packages/data-sanitization/**' + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - '.oxlintrc.json' + - '.oxfmtrc.json' + - '.github/workflows/ci-data-sanitization.yml' + pull_request: + branches: [main] + paths: + - 'packages/data-sanitization/**' + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - '.oxlintrc.json' + - '.oxfmtrc.json' + - '.github/workflows/ci-data-sanitization.yml' + +jobs: + ci: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + strategy: + fail-fast: false + matrix: + node-version: [22, 24] + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - run: corepack enable + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - run: | + git config --global user.name "CI" + git config --global user.email "ci@localhost" + git config --global init.defaultBranch main + - run: yarn install --immutable + - run: yarn workspace data-sanitization format:check + - run: yarn workspace data-sanitization lint:ci + - run: yarn workspace data-sanitization build + - run: yarn workspace data-sanitization test:coverage + - name: Report coverage + if: matrix.node-version == 24 + uses: davelosert/vitest-coverage-report-action@02f3c2e641286b7fa308cd3e430783103ce6103b # v2 + with: + json-summary-path: coverage/coverage-summary.json + json-final-path: coverage/coverage-final.json + working-directory: packages/data-sanitization + - name: Extract coverage percentage + id: coverage + if: matrix.node-version == 24 && github.event_name == 'push' + run: echo "percentage=$(jq '.total.lines.pct' packages/data-sanitization/coverage/coverage-summary.json)" >> "$GITHUB_OUTPUT" + - name: Update coverage badge + if: matrix.node-version == 24 && github.event_name == 'push' + uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0 + with: + auth: ${{ secrets.GIST_SECRET }} + gistID: ${{ vars.COVERAGE_GIST_ID }} + filename: data-sanitization-coverage-badge-config.json + label: coverage + message: ${{ steps.coverage.outputs.percentage }}% + valColorRange: ${{ steps.coverage.outputs.percentage }} + maxColorRange: 100 + minColorRange: 0 + - name: Update coverage report in Gist + if: matrix.node-version == 24 && github.event_name == 'push' + env: + COVERAGE_GIST_ID: ${{ vars.COVERAGE_GIST_ID }} + GIST_SECRET: ${{ secrets.GIST_SECRET }} + run: yarn workspace data-sanitization node scripts/update-coverage-gist.mjs --package-name data-sanitization diff --git a/.github/workflows/ci-root.yml b/.github/workflows/ci-root.yml new file mode 100644 index 0000000..2d30355 --- /dev/null +++ b/.github/workflows/ci-root.yml @@ -0,0 +1,51 @@ +name: CI (root) + +on: + push: + branches: [main] + paths: + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - 'lint-staged.config.mjs' + - '*.md' + - 'docs/**' + - '.github/**' + - '!.github/workflows/ci-data-sanitization.yml' + - '!.github/workflows/ci-data-sanitization-log-providers.yml' + pull_request: + branches: [main] + paths: + - 'package.json' + - 'yarn.lock' + - '.yarnrc.yml' + - 'tsconfig.json' + - '.markdownlint.json' + - '.markdownlintignore' + - 'lint-staged.config.mjs' + - '*.md' + - 'docs/**' + - '.github/**' + - '!.github/workflows/ci-data-sanitization.yml' + - '!.github/workflows/ci-data-sanitization-log-providers.yml' + +jobs: + ci-root: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + - run: corepack enable + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + with: + node-version: 22 + cache: yarn + - run: yarn install --immutable + - run: yarn format:check + - run: yarn lint:ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 3c2f874..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - ci: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - strategy: - fail-fast: false - matrix: - node-version: [22, 24] - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - persist-credentials: false - - run: corepack enable - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - - run: | - git config --global user.name "CI" - git config --global user.email "ci@localhost" - git config --global init.defaultBranch main - - run: yarn install --immutable - - run: yarn format:check - - run: yarn lint:ci - - run: yarn build - - run: yarn test:coverage - - name: Report coverage (data-sanitization) - if: matrix.node-version == 24 - uses: davelosert/vitest-coverage-report-action@02f3c2e641286b7fa308cd3e430783103ce6103b # v2 - with: - json-summary-path: coverage/coverage-summary.json - json-final-path: coverage/coverage-final.json - working-directory: packages/data-sanitization - - name: Extract coverage percentage (data-sanitization) - id: coverage-data-sanitization - if: matrix.node-version == 24 && github.event_name == 'push' - run: echo "percentage=$(jq '.total.lines.pct' packages/data-sanitization/coverage/coverage-summary.json)" >> "$GITHUB_OUTPUT" - - name: Update coverage badge (data-sanitization) - if: matrix.node-version == 24 && github.event_name == 'push' - uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0 - with: - auth: ${{ secrets.GIST_SECRET }} - gistID: ${{ vars.COVERAGE_GIST_ID }} - filename: data-sanitization-coverage-badge-config.json - label: coverage - message: ${{ steps.coverage-data-sanitization.outputs.percentage }}% - valColorRange: ${{ steps.coverage-data-sanitization.outputs.percentage }} - maxColorRange: 100 - minColorRange: 0 - - name: Update coverage report in Gist (data-sanitization) - if: matrix.node-version == 24 && github.event_name == 'push' - env: - COVERAGE_GIST_ID: ${{ vars.COVERAGE_GIST_ID }} - GIST_SECRET: ${{ secrets.GIST_SECRET }} - run: yarn workspace data-sanitization node scripts/update-coverage-gist.mjs --package-name data-sanitization - - name: Report coverage (data-sanitization-log-providers) - if: matrix.node-version == 24 - uses: davelosert/vitest-coverage-report-action@02f3c2e641286b7fa308cd3e430783103ce6103b # v2 - with: - json-summary-path: coverage/coverage-summary.json - json-final-path: coverage/coverage-final.json - working-directory: packages/data-sanitization-log-providers - - name: Extract coverage percentage (data-sanitization-log-providers) - id: coverage-log-providers - if: matrix.node-version == 24 && github.event_name == 'push' - run: echo "percentage=$(jq '.total.lines.pct' packages/data-sanitization-log-providers/coverage/coverage-summary.json)" >> "$GITHUB_OUTPUT" - - name: Update coverage badge (data-sanitization-log-providers) - if: matrix.node-version == 24 && github.event_name == 'push' - uses: schneegans/dynamic-badges-action@0e50b8bad39e7e1afd3e4e9c2b7dd145fad07501 # v1.8.0 - with: - auth: ${{ secrets.GIST_SECRET }} - gistID: ${{ vars.COVERAGE_GIST_ID }} - filename: data-sanitization-log-providers-coverage-badge-config.json - label: coverage - message: ${{ steps.coverage-log-providers.outputs.percentage }}% - valColorRange: ${{ steps.coverage-log-providers.outputs.percentage }} - maxColorRange: 100 - minColorRange: 0 - - name: Update coverage report in Gist (data-sanitization-log-providers) - if: matrix.node-version == 24 && github.event_name == 'push' - env: - COVERAGE_GIST_ID: ${{ vars.COVERAGE_GIST_ID }} - GIST_SECRET: ${{ secrets.GIST_SECRET }} - run: yarn workspace data-sanitization-log-providers node ../data-sanitization/scripts/update-coverage-gist.mjs --package-name data-sanitization-log-providers diff --git a/docs/superpowers/plans/2026-05-26-ci-and-script-cleanup.md b/docs/superpowers/plans/2026-05-26-ci-and-script-cleanup.md new file mode 100644 index 0000000..498d8f1 --- /dev/null +++ b/docs/superpowers/plans/2026-05-26-ci-and-script-cleanup.md @@ -0,0 +1,649 @@ +# CI and Script Cleanup Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development +> (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use +> checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Remove duplicate `npm` script suffixes (`:code`, `:src`) from all workspaces by +renaming root orchestrators to `:all`, then split the single `ci.yml` into three per-package +workflows with path filters so CI only runs for changed workspaces. + +**Architecture:** Root gets `