build(deps): Bump glob from 10.4.5 to 10.5.0 (#47) #79
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: [ master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ master ] | |
| paths-ignore: | |
| - "*.md" | |
| - "docs/**" | |
| - "media/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| jobs: | |
| ci: | |
| name: Tests & Build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| node-version: [ 18.x, 20.x, 22.x ] | |
| os: [ ubuntu-latest ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Type check | |
| run: npm run test:types | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests with coverage | |
| if: matrix.node-version == '22.x' | |
| run: npm run test:coverage # ← USE THIS for coverage | |
| - name: Run tests | |
| if: matrix.node-version != '22.x' | |
| run: npm test | |
| - name: Upload coverage artifact | |
| if: matrix.os == 'ubuntu-latest' && matrix.node-version == '22.x' | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| typescript: | |
| name: TypeScript Compatibility | |
| runs-on: ubuntu-latest | |
| needs: [ ci ] | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| ts-version: [ ~5.8, ~5.9 ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install TypeScript ${{ matrix.ts-version }} | |
| run: npm install typescript@${{ matrix.ts-version }} | |
| - name: Check TypeScript version | |
| run: ./node_modules/typescript/bin/tsc --version | |
| - name: Type check with TypeScript ${{ matrix.ts-version }} | |
| run: ./node_modules/typescript/bin/tsc --noEmit | |
| - name: Build with TypeScript ${{ matrix.ts-version }} | |
| run: npm run build | |
| lockfile-check: | |
| name: Validate package-lock.json | |
| runs-on: ubuntu-latest | |
| needs: [ ci, typescript ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check package-lock integrity | |
| run: | | |
| npm -v | |
| checksum=$(sha512sum package-lock.json) | |
| npm install --package-lock-only --no-audit | |
| if ! echo ${checksum} | sha512sum --quiet -c -; then | |
| echo "package-lock.json was modified unexpectedly" | |
| echo "Please rebuild it using npm@$(npm -v) and commit the changes" | |
| exit 1 | |
| fi | |
| quality-scan: | |
| name: Code Quality Analysis | |
| runs-on: ubuntu-latest | |
| needs: [ ci, typescript, lockfile-check ] | |
| if: ${{ always() && (needs.ci.result == 'success') }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| - name: Verify coverage output | |
| run: | | |
| if [ ! -f coverage/lcov.info ]; then | |
| echo "❌ ERROR: coverage/lcov.info not found" | |
| ls -la coverage/ || echo "coverage/ directory doesn't exist" | |
| exit 1 | |
| fi | |
| echo "✅ Coverage output found" | |
| head -20 coverage/lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: codecov-coverage | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@master | |
| env: | |
| SONAR_HOST_URL: https://sonarcloud.io | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.projectKey=klaudiosinani_singlie | |
| -Dsonar.organization=klaudiosinani | |
| -Dsonar.sources=src | |
| -Dsonar.tests=test | |
| -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
| -Dsonar.coverage.exclusions=**/*.spec.ts,node_modules/** | |
| -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} | |
| - name: SonarQube Quality Gate | |
| uses: SonarSource/sonarqube-quality-gate-action@master | |
| timeout-minutes: 5 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |