test(harness): extract shared gitInitMain helper #43
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Lint and format check | |
| run: bun run check | |
| - name: Tool schema snapshot check | |
| run: bun run schema:tools:check | |
| - name: Unit tests with coverage | |
| run: | | |
| bun run test:coverage 2>&1 | tee /tmp/coverage.txt | |
| bun run coverage:check /tmp/coverage.txt 80 | |
| - name: Assert Node.js version | |
| run: node -e "const v=+process.version.slice(1).split('.')[0]; if(v<22)process.exit(1)" | |
| prerelease-pack: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.11 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| - name: Assert Node.js version | |
| run: node -e "const v=+process.version.slice(1).split('.')[0]; if(v<22)process.exit(1)" | |
| - name: Pack npm tarball (prerelease snapshot) | |
| id: pack | |
| run: | | |
| set -euo pipefail | |
| npm pack | |
| SRC=$(ls -t rethunk-mcp-multi-root-git-*.tgz | head -1) | |
| DEST="rethunk-mcp-multi-root-git-prerelease-${{ github.sha }}.tgz" | |
| mv "$SRC" "$DEST" | |
| echo "tarball=$DEST" >> "$GITHUB_OUTPUT" | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: npm-pack-prerelease-${{ github.sha }} | |
| path: ${{ steps.pack.outputs.tarball }} | |
| if-no-files-found: error | |
| retention-days: 90 |