chore(deps-dev): bump rollup from 4.50.0 to 4.52.5 #102
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-test-pack: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Prepare Artifact Directories | |
| run: node -e "['artifacts/test-results/js','artifacts/test-results/dotnet','artifacts/coverage/js','artifacts/coverage'].forEach(d=>require('fs').mkdirSync(d,{recursive:true}));" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore EdNotes.sln | |
| - name: Install JS deps | |
| run: npm ci | |
| - name: Lint JS | |
| run: npm run lint | |
| - name: JS Tests | |
| run: node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand --coverage --coverageDirectory=artifacts/coverage/js | |
| - name: JS Coverage Threshold | |
| run: node scripts/coverage-threshold.mjs | |
| - name: Upload JS Test Results (if any) | |
| if: always() && hashFiles('artifacts/test-results/js/**') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: js-test-results-${{ runner.os }} | |
| path: artifacts/test-results/js | |
| - name: Upload JS Coverage | |
| if: always() && hashFiles('artifacts/coverage/js/**') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: js-coverage-${{ runner.os }} | |
| path: artifacts/coverage/js | |
| - name: Build | |
| run: dotnet build EdNotes.sln --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test tests/unit/EdNotes.RichText.Tests.csproj --no-build --configuration Release --logger trx --collect:"XPlat Code Coverage" --results-directory artifacts/test-results/dotnet | |
| - name: Upload .NET Test Results | |
| if: always() && hashFiles('artifacts/test-results/dotnet/**') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dotnet-test-results-${{ runner.os }} | |
| path: artifacts/test-results/dotnet | |
| - name: Extract .NET Coverage | |
| if: always() | |
| run: | | |
| echo "Scanning for .cobertura.xml files..." | |
| node -e "const fs=require('fs'),path=require('path');function walk(d){return fs.readdirSync(d,{withFileTypes:true}).flatMap(e=>{const p=path.join(d,e.name);return e.isDirectory()?walk(p):(p.endsWith('.cobertura.xml')?[p]:[]);});}if(!fs.existsSync('artifacts/test-results/dotnet')){console.log('No dotnet test results dir');process.exit(0);}const files=walk('artifacts/test-results/dotnet');if(files.length){fs.mkdirSync('artifacts/coverage',{recursive:true});fs.copyFileSync(files[0],'artifacts/coverage/dotnet.cobertura.xml');console.log('Copied coverage from',files[0]);}else{console.log('No cobertura file found (will attempt reportgenerator if installed)');process.exit(0);}" | |
| # Optionally generate a normalized Cobertura report & HTML summary if reportgenerator is available | |
| echo "Attempting to install reportgenerator (optional)..." | |
| dotnet tool install --global dotnet-reportgenerator-globaltool || echo "reportgenerator install skipped" | |
| echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
| if command -v reportgenerator >/dev/null 2>&1; then | |
| mkdir -p artifacts/coverage/dotnet | |
| reportgenerator -reports:"artifacts/test-results/dotnet/**/coverage.cobertura.xml" -targetdir:"artifacts/coverage/dotnet" -reporttypes:"Cobertura;HtmlSummary" || echo "reportgenerator execution failed (non-fatal)" | |
| # Normalize output filename if present | |
| if [ -f artifacts/coverage/dotnet/Cobertura.xml ]; then | |
| cp artifacts/coverage/dotnet/Cobertura.xml artifacts/coverage/dotnet.cobertura.xml | |
| fi | |
| else | |
| echo "reportgenerator not available; using raw copied cobertura file if present" | |
| fi | |
| - name: .NET Coverage Threshold | |
| if: success() | |
| run: node scripts/dotnet-coverage-threshold.mjs | |
| - name: Upload .NET Coverage | |
| if: always() && hashFiles('artifacts/coverage/dotnet.cobertura.xml') != '' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dotnet-coverage-${{ runner.os }} | |
| path: artifacts/coverage | |
| - name: Coverage Summary | |
| if: always() | |
| run: >- | |
| node -e "const fs=require('fs'); | |
| if(fs.existsSync('artifacts/coverage/js')){console.log('JS coverage files:'); | |
| for(const f of fs.readdirSync('artifacts/coverage/js')) console.log(' - '+f); | |
| } else console.log('No JS coverage'); | |
| if(fs.existsSync('artifacts/coverage/dotnet.cobertura.xml')) console.log('DotNet coverage: Found dotnet coverage file'); else console.log('DotNet coverage: No dotnet coverage file');" | |
| - name: Performance Benchmark | |
| if: success() && runner.os == 'Linux' | |
| run: node scripts/bench-normalize.mjs 800 > artifacts/benchmark-normalize.json | |
| - name: Performance Regression Gate | |
| if: success() && runner.os == 'Linux' | |
| env: | |
| PERF_BASELINE_MS_PER_BLOCK: 0.60 | |
| PERF_TOLERANCE_PCT: 20 | |
| run: node scripts/perf-regression-check.mjs | |
| - name: Pack | |
| run: dotnet pack src/EdNotes.RichText/EdNotes.RichText.csproj -c Release -o ./artifacts | |
| - name: Upload Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package-${{ runner.os }} | |
| path: artifacts/*.nupkg |