chore(husky): add prepare-commit-msg hook for machine-global co-autho… #55
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| actions: read | |
| contents: read | |
| issues: write | |
| jobs: | |
| lint-and-typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Type-check | |
| run: pnpm typecheck | |
| - name: Format check | |
| run: pnpm format:check | |
| - name: Docs governance | |
| run: pnpm docs:lint | |
| - name: Skills validation | |
| run: pnpm skills:lint | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "lint-and-typecheck" "${{ github.run_id }}" | |
| go-qa: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: packages/golangci-lint/go.mod | |
| - name: Verify Go formatting | |
| run: test -z "$(cd packages/golangci-lint && gofmt -l analyzer plugin)" | |
| - name: Verify Go analyzer | |
| run: cd packages/golangci-lint && go test ./... | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "go-qa" "${{ github.run_id }}" | |
| python-qa: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Verify Python checker | |
| run: | | |
| python3 -m unittest discover -s packages/python/tests -t packages/python | |
| python3 -m compileall -q packages/python/codecontext_python | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "python-qa" "${{ github.run_id }}" | |
| ruby-qa: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.2" | |
| - name: Verify Ruby checker | |
| run: | | |
| cd packages/ruby | |
| ruby -Ilib -e 'Dir["test/**/*_test.rb"].sort.each { |file| require File.expand_path(file) }' | |
| gem build codecontext-ruby.gemspec >/dev/null | |
| rm -f codecontext-ruby-*.gem | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "ruby-qa" "${{ github.run_id }}" | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-typecheck, go-qa, python-qa, ruby-qa] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - name: Run tests with coverage | |
| run: pnpm --filter @recallnet/codecontext-parser test:coverage | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "test" "${{ github.run_id }}" | |
| build-verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: packages/golangci-lint/go.mod | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Verify CLI entry point | |
| run: node packages/cli/dist/index.js --help | |
| - name: Verify parser exports | |
| run: node -e "const m = await import('./packages/parser/dist/index.js'); if (!m.parseContextTags) throw new Error('Missing export'); console.log('Parser exports OK');" | |
| - name: Verify ESLint plugin exports | |
| run: node -e "const m = await import('./packages/eslint-plugin/dist/index.js'); if (!m.default?.rules) throw new Error('Missing rules'); console.log('ESLint plugin exports OK');" | |
| - name: Verify pi extension exports | |
| run: node -e "const m = await import('./packages/pi/dist/index.js'); if (typeof m.default !== 'function') throw new Error('Missing extension export'); console.log('pi extension exports OK');" | |
| - name: Verify Go analyzer package | |
| run: pnpm go:test | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "build-verify" "${{ github.run_id }}" | |
| changeset-check: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - name: Check for changesets | |
| run: | | |
| CHANGED=$(git diff --name-only origin/main...HEAD | grep -E '^packages/(parser|cli|eslint-plugin)/src/' || true) | |
| if [ -n "$CHANGED" ]; then | |
| CHANGESETS=$(git diff --name-only origin/main...HEAD | grep -E '^\.changeset/.*\.md$' || true) | |
| if [ -z "$CHANGESETS" ]; then | |
| echo "::warning::Source files changed in publishable packages but no changeset found. Run 'pnpm changeset' before merging." | |
| fi | |
| fi | |
| - name: Open ticket on failure | |
| if: >- | |
| failure() && | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: .github/scripts/ci-failure-ticket.sh "changeset-check" "${{ github.run_id }}" |