Skip to content

Fix worker thread OOM by removing fake tests and switching to vmThreads #801

Fix worker thread OOM by removing fake tests and switching to vmThreads

Fix worker thread OOM by removing fake tests and switching to vmThreads #801

Workflow file for this run

name: Quality Checks
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
permissions:
contents: read
jobs:
html-validation:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '24'
- name: Cache npm global packages
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-global-${{ hashFiles('**/package-lock.json') }}-htmlhint
restore-keys: |
${{ runner.os }}-npm-global-
- name: Install HTMLHint
run: npm install -g htmlhint
- name: Validate HTML
run: |
echo "🔍 Validating HTML files with HTMLHint..."
echo ""
# Build file list robustly (handles missing news/*.html gracefully)
shopt -s nullglob
html_files=(*.html)
[[ -d news ]] && html_files+=(news/*.html)
shopt -u nullglob
# Run HTMLHint on all HTML files and capture results
if htmlhint "${html_files[@]}" > htmlhint-report.txt 2>&1; then
echo "✅ All HTML files passed validation"
cat htmlhint-report.txt
else
echo "⚠️ HTML validation found issues:"
cat htmlhint-report.txt
echo ""
echo "📊 Validation completed with warnings/errors"
# Don't fail the build on HTML validation issues initially
# exit 1
fi
- name: Upload HTMLHint Report
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: htmlhint-report
path: htmlhint-report.txt
retention-days: 30
link-checker:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '24'
- name: Cache npm packages
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-linkinator6-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-linkinator6-
- name: Cache apt packages
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/.github/workflows/quality-checks.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install linkinator@6
run: |
echo "Installing linkinator v6 (v7.5.2 has module resolution bug)..."
npm install -g linkinator@6
linkinator --version
echo "✅ linkinator v6 installed successfully"
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Check internal links (static files)
run: |
echo "🔍 Starting local HTTP server for internal link checking..."
python3 -m http.server 8080 &
SERVER_PID=$!
echo "Server PID: $SERVER_PID"
# Wait for server to start
sleep 5
echo ""
echo "🔗 Checking internal links on localhost..."
# Check links on localhost using global linkinator v6
linkinator http://localhost:8080/ \
--recurse \
--skip "^(?!http://localhost:8080)" \
--format json > internal-links-report.json || true
# Kill server
kill $SERVER_PID 2>/dev/null || true
# Parse and display results
echo ""
echo "📊 Internal Link Check Results:"
if [ -f internal-links-report.json ]; then
jq '.links[0:10]' internal-links-report.json
# Count passed and failed links
read passed failed < <(jq -r '
[([.links[] | select(.state == "OK")] | length),
([.links[] | select(.state != "OK")] | length)] | @tsv
' internal-links-report.json 2>/dev/null || echo "0 0")
echo ""
echo "✅ Passed: $passed links"
echo "❌ Failed: $failed links"
fi
- name: Check external links (sample pages)
run: |
echo ""
echo "🌐 Checking external links on deployed site (sample check)..."
echo "Note: Only checking main index page to avoid rate limiting"
# Check external links on deployed site
linkinator https://riksdagsmonitor.com/ \
--skip "(fonts\.googleapis\.com|fonts\.gstatic\.com|github\.com)" \
--timeout 30000 \
--format json > external-links-report.json || true
echo ""
echo "📊 External Link Check Results:"
if [ -f external-links-report.json ]; then
jq '.links[0:10]' external-links-report.json
# Count passed and failed links
read passed failed < <(jq -r '
[([.links[] | select(.state == "OK")] | length),
([.links[] | select(.state != "OK")] | length)] | @tsv
' external-links-report.json 2>/dev/null || echo "0 0")
echo ""
echo "✅ Passed: $passed links"
echo "❌ Failed: $failed links"
echo ""
echo "ℹ️ Note: External link checking is limited to avoid rate limiting"
fi
- name: Upload Link Check Reports
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: link-checker-reports
path: |
internal-links-report.json
external-links-report.json
retention-days: 30
summary:
runs-on: ubuntu-latest
needs: [html-validation, link-checker]
if: always()
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Quality Check Summary
run: |
echo "=========================================="
echo " Quality Checks Completed"
echo "=========================================="
echo ""
echo "✅ HTML validation completed"
echo "✅ Link checking completed"
echo ""
echo "📊 Check artifacts for detailed reports:"
echo " - htmlhint-report"
echo " - link-checker-reports"
echo ""
echo "=========================================="