Skip to content

chore: gitignore .claude/scheduled_tasks.lock runtime lockfile #224

chore: gitignore .claude/scheduled_tasks.lock runtime lockfile

chore: gitignore .claude/scheduled_tasks.lock runtime lockfile #224

Workflow file for this run

name: Run Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
typecheck-and-test:
name: TypeScript & Jest
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- run: npm ci
- name: Validate translations
run: node scripts/validate-translations.js
- name: TypeScript compilation check
run: npx tsc --noEmit
- name: Run tests with coverage
run: npx jest --ci --coverage --coverageReporters=json-summary --coverageReporters=text
- name: Generate coverage badge
if: github.ref == 'refs/heads/master'
run: |
PCT=$(node -e "console.log(require('./coverage/coverage-summary.json').total.statements.pct)")
if (( $(echo "$PCT >= 90" | bc -l) )); then COLOR="brightgreen"
elif (( $(echo "$PCT >= 80" | bc -l) )); then COLOR="green"
elif (( $(echo "$PCT >= 70" | bc -l) )); then COLOR="yellow"
elif (( $(echo "$PCT >= 60" | bc -l) )); then COLOR="orange"
else COLOR="red"; fi
mkdir -p badges
curl -s "https://img.shields.io/badge/coverage-${PCT}%25-${COLOR}" > badges/coverage.svg
- name: Commit badge
if: github.ref == 'refs/heads/master'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add badges/coverage.svg
if git diff --cached --quiet; then
echo "Badge unchanged, nothing to commit."
exit 0
fi
git commit -m "ci: update coverage badge [skip ci]"
for i in 1 2 3; do
git pull --rebase origin master && git push && exit 0
echo "Push attempt $i failed, retrying..."
sleep 2
done
echo "::warning::Badge push failed after 3 attempts — tests passed, badge not updated."