feat: enhance deps-graph command with collapse and exclude options fo… #200
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: | |
| - '**' | |
| tags: | |
| - '!**' # Don't run twice on commits with tags | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| FORCE_COLOR: 1 | |
| jobs: | |
| lint-test: | |
| name: Lint and test (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [20, 22, 24] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Audit | |
| run: npm audit --omit dev | |
| - name: Lint | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Build | |
| run: npm run build | |
| - name: Validate build artifacts | |
| run: | | |
| # Verify main entry point exists and is executable | |
| test -f dist/index.js || (echo "ERROR: dist/index.js not found" && exit 1) | |
| test -x dist/index.js || (echo "ERROR: dist/index.js is not executable" && exit 1) | |
| # Verify TypeScript declaration files are generated | |
| test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found" && exit 1) | |
| # Count JS and declaration files to ensure build produced output | |
| JS_COUNT=$(find dist -name "*.js" | wc -l) | |
| DTS_COUNT=$(find dist -name "*.d.ts" | wc -l) | |
| echo "Build artifacts validated:" | |
| echo " - JavaScript files: $JS_COUNT" | |
| echo " - Declaration files: $DTS_COUNT" | |
| # Ensure we have a reasonable number of output files | |
| test "$JS_COUNT" -gt 5 || (echo "ERROR: Too few JS files in dist/" && exit 1) | |
| test "$DTS_COUNT" -gt 5 || (echo "ERROR: Too few declaration files in dist/" && exit 1) | |
| - name: Test | |
| run: npm test | |
| coverage: | |
| name: Test coverage | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Generate test coverage | |
| run: npm run test:coverage | |
| - name: Upload test coverage | |
| uses: codecov/codecov-action@v6 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |