* refactor: resolve oxlint correctness findings without behavior changes - Snapshot iterations that mutate their collection with Array.from() instead of a spread (live childNodes, self-removing disposers, a Set extended inside its own loop). - Drop empty spread fallbacks, redundant regex escapes, Boolean() casts inside negations, a rethrow-only try/catch and statement ternaries. - Use startsWith/endsWith for anchored literal checks in the extension. - List U+FE0F explicitly in the mobile attachment emoji class; the matched set is unchanged. - Fix the WeChat copy fixture, where \oint in a template literal lost its backslash and the block formula never exercised \oint. - Document the intentional control-character regexes (filename sanitizing and input validation), the throwing provider stream test, Astro's generated type reference and the mobile auto-sync finally block with narrow inline exceptions. * ci: run oxlint correctness rules on pull requests Pin oxlint 1.88.0 and enable only its correctness category across apps/ and packages/, excluding build output, vendored code and the iOS app. Findings are errors and the script passes --deny-warnings, so CI fails on any finding. no-unused-vars stays off until unused code is removed in a dedicated pass.
95 lines
2.2 KiB
YAML
95 lines
2.2 KiB
YAML
name: Test
|
|
|
|
# Runs the non-E2E regression suite, lint, type checks and the web build for every
|
|
# pull request and every push to main, so failures surface before a release
|
|
# instead of in the release workflow.
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- "**/*.md"
|
|
- "docs/**"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**/*.md"
|
|
- "docs/**"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: edgeever-test-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
checks:
|
|
# Forks that deploy their own copy do not spend runners on this; pull
|
|
# requests opened against this repository still run here.
|
|
if: github.repository == 'tianma-if/edgeever'
|
|
name: Type check and build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version-file: package.json
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
for attempt in 1 2 3; do
|
|
if bun install --frozen-lockfile; then
|
|
exit 0
|
|
fi
|
|
if [[ "$attempt" = "3" ]]; then
|
|
exit 1
|
|
fi
|
|
sleep "$((15 * attempt))"
|
|
done
|
|
|
|
- name: Lint
|
|
run: bun run lint
|
|
|
|
- name: Type check
|
|
run: bun run typecheck
|
|
|
|
- name: Type check mobile
|
|
run: bun run typecheck:mobile
|
|
|
|
- name: Build web
|
|
run: bun run build:web
|
|
|
|
tests:
|
|
if: github.repository == 'tianma-if/edgeever'
|
|
name: Regression tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version-file: package.json
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
for attempt in 1 2 3; do
|
|
if bun install --frozen-lockfile; then
|
|
exit 0
|
|
fi
|
|
if [[ "$attempt" = "3" ]]; then
|
|
exit 1
|
|
fi
|
|
sleep "$((15 * attempt))"
|
|
done
|
|
|
|
- name: Run regression tests
|
|
run: bun run test
|