93 lines
2.4 KiB
YAML
93 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
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
|
|
echo "Bun already installed: $(bun --version)"
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash
|
|
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
|
|
echo "Bun already installed: $(bun --version)"
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash
|
|
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
|
|
echo "Bun already installed: $(bun --version)"
|
|
else
|
|
curl -fsSL https://bun.sh/install | bash
|
|
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Run TypeScript type check
|
|
run: bun run typecheck
|