Forgejo uses the per-repo sequential run index (GITHUB_RUN_NUMBER) in action URLs, not the internal DB run ID (GITHUB_RUN_ID). This caused "View job" links to return 404. Fixed in all 4 URL construction sites: create-initial comment, update-comment-link, and both prompt generators. Also pins Bun to 1.2.21 in CI — Bun 1.3.9 broke spyOn(fs, ...) which failed 18 upstream image-downloader tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
119 lines
3.6 KiB
YAML
119 lines
3.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
# Pin Bun version across all jobs. Bun 1.3.x broke spyOn(fs, ...) in tests.
|
|
# Bump this when upstream tests are updated for newer Bun versions.
|
|
env:
|
|
BUN_VERSION: "1.2.21"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: grunt
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/xternal/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
if command -v bun &> /dev/null; then
|
|
INSTALLED=$(bun --version)
|
|
if [ "$INSTALLED" = "$BUN_VERSION" ]; then
|
|
echo "Bun $BUN_VERSION already installed"
|
|
else
|
|
echo "Bun $INSTALLED installed, need $BUN_VERSION — reinstalling"
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run tests
|
|
# Unit tests assume GitHub context. Override Forgejo runner's
|
|
# GITHUB_SERVER_URL so module-level constants (config.ts) and
|
|
# detectPlatform() default to GitHub. Forgejo-specific tests
|
|
# explicitly set PLATFORM=forgejo in their own beforeEach.
|
|
# Inline export because Forgejo runner re-injects GITHUB_SERVER_URL
|
|
# after step-level env:, overriding it.
|
|
run: |
|
|
export GITHUB_SERVER_URL=https://github.com
|
|
bun test
|
|
|
|
prettier:
|
|
runs-on: grunt
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/xternal/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
if command -v bun &> /dev/null; then
|
|
INSTALLED=$(bun --version)
|
|
if [ "$INSTALLED" = "$BUN_VERSION" ]; then
|
|
echo "Bun $BUN_VERSION already installed"
|
|
else
|
|
echo "Bun $INSTALLED installed, need $BUN_VERSION — reinstalling"
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run prettier check
|
|
run: bun run format:check
|
|
|
|
typecheck:
|
|
runs-on: grunt
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://${{ secrets.READ_REPO_TOKEN }}@git.wxs.ro/xternal/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
if command -v bun &> /dev/null; then
|
|
INSTALLED=$(bun --version)
|
|
if [ "$INSTALLED" = "$BUN_VERSION" ]; then
|
|
echo "Bun $BUN_VERSION already installed"
|
|
else
|
|
echo "Bun $INSTALLED installed, need $BUN_VERSION — reinstalling"
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}"
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run TypeScript type check
|
|
run: bun run typecheck
|