feat: Major improvements for v1.1.0 (#14) #75
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] | |
| jobs: | |
| # =========================================== | |
| # Build and Test | |
| # =========================================== | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| - name: Run tests with coverage | |
| if: matrix.node-version == 20 | |
| run: npm run test:coverage | |
| - name: Upload coverage to Codecov | |
| if: matrix.node-version == 20 | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| # =========================================== | |
| # Lint and Format | |
| # =========================================== | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Biome check | |
| run: npm run check | |
| - name: Type check | |
| run: npx tsc --noEmit | |
| # =========================================== | |
| # Architecture Validation | |
| # =========================================== | |
| validate-architecture: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Validate architecture with dependency-cruiser | |
| run: npm run validate:arch | |
| # =========================================== | |
| # Profile Validation | |
| # =========================================== | |
| validate-profiles: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Validate all profiles load correctly | |
| run: | | |
| node -e " | |
| import('./dist/profiles.js').then(async ({ listProfiles }) => { | |
| const profiles = await listProfiles(); | |
| console.log('Loaded profiles:', profiles.map(p => p.id)); | |
| if (profiles.length === 0) { | |
| process.exit(1); | |
| } | |
| console.log('All profiles validated successfully!'); | |
| }).catch(err => { | |
| console.error('Profile validation failed:', err); | |
| process.exit(1); | |
| }); | |
| " | |
| # =========================================== | |
| # Security Scanning | |
| # =========================================== | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run npm audit | |
| run: npm audit --audit-level=high | |
| continue-on-error: true | |
| - name: Run Snyk security scan | |
| uses: snyk/actions/node@master | |
| continue-on-error: true | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| args: --severity-threshold=high |