Skip to content

feat(ui): native-text BibleReader body and footnotes #1279

feat(ui): native-text BibleReader body and footnotes

feat(ui): native-text BibleReader body and footnotes #1279

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
# Cancel in-progress runs when a new commit is pushed to the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Run lint
run: pnpm lint --max-warnings=0
- name: Run native i18n oxlint regression tests
run: pnpm lint:native-i18n
- name: Run no-raw-color oxlint regression tests
run: pnpm lint:no-raw-color
# `test:ci-scripts` runs the bash signoff suite plus every scripts/*.test.mjs,
# which includes the iOS tooling suite, so a separate step for it would run
# that suite twice. `pnpm test:ios-dev` stays in package.json for local use.
- name: Run repo script regression tests
run: pnpm test:ci-scripts
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Run tsc
run: pnpm typecheck
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Build all publishable packages
# Uses turbo's dependency-ordered build (core → ui) so a
# workspace dep can't get published with a stale build.
run: pnpm exec turbo run build
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Run Jest
run: pnpm exec turbo run test -- --coverage --ci --maxWorkers=2
- name: Upload coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage
path: '**/coverage/'
- name: Build coverage badge JSON for shields.io
run: |
mkdir -p coverage-output
for pkg in core ui; do
summary="packages/$pkg/coverage/coverage-summary.json"
if [ ! -f "$summary" ]; then
echo "Missing coverage summary: $summary" >&2
exit 1
fi
pct=$(jq '.total.lines.pct' "$summary")
color=$(node -e "const p=$pct; console.log(p >= 80 ? 'brightgreen' : p >= 60 ? 'yellow' : 'red')")
jq -n --arg label "$pkg coverage" --arg message "$pct%" --arg color "$color" \
'{schemaVersion: 1, label: $label, message: $message, color: $color}' > "coverage-output/$pkg.json"
done
- name: Upload coverage badge artifacts
uses: actions/upload-artifact@v7
with:
name: coverage-badges
path: coverage-output/
# Coverage badges live on an orphan `badges` branch, out of main's history.
publish-coverage-badges:
name: Publish coverage badges
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out badges branch
uses: actions/checkout@v6
with:
ref: badges
path: badges-branch
- name: Download coverage badge artifacts
uses: actions/download-artifact@v7
with:
name: coverage-badges
path: coverage-output
- name: Commit coverage badges to badges branch
working-directory: badges-branch
run: |
# Replace the full set so a dropped package's stale badge can't linger.
rm -f ./*.json
cp ../coverage-output/*.json .
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git diff --staged --quiet || git commit -m "chore: update coverage badges"
git push
locale-parity:
name: Locale parity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
- name: Check locale key parity
run: node scripts/check-locale-parity.mjs
- name: Regenerate locale index
run: pnpm generate:locale-index
- name: Verify locale index is committed
run: git diff --exit-code packages/ui/src/i18n/locales/index.ts
locale-json-guard:
name: Locale JSON guard
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Block hand-edited locale JSON
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_BASE_REF: ${{ github.base_ref }}
PR_LABELS_JSON: ${{ toJson(github.event.pull_request.labels) }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "HEAD_COMMIT_MESSAGE=$(git log -1 --pretty=%s)" >> "$GITHUB_ENV"
node scripts/check-locale-parity.mjs --guard