storebound/.forgejo/workflows/ci.yml

77 lines
3.4 KiB
YAML

# bun run ci on every push to main and every pull request into main: adapters, desktop version, tests, typecheck,
# desktop i18n / typecheck / build, desktop boot check (headless Chromium), desktop Rust tests and clippy, scrub. Runs on the VDS runner (docs/desktop-release.md).
# tools/ci.ts runs the steps as a task graph and the tests as parallel shards (CPU cores - 1, max 8) on the one
# self-hosted runner, so a job matrix would only queue; CI=full makes it run the Rust steps on every push.
# Publishes nothing: site/ is still published by Jenkins; releases come from release.yml (a v* tag).
# acceptance-quick: the quick subset of the acceptance matrix (tools/acceptance.ts) on the Linux and Windows runners.
# release.yml's ci job runs the same steps (the setup is shared: .forgejo/actions/linux-setup).
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
BUN_VERSION: '1.4.0'
CARGO_TERM_COLOR: never
CARGO_INCREMENTAL: '0'
CI: full
jobs:
ci:
# runner label: ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04
runs-on: ubuntu-22.04
# the self-hosted runner only runs code from this repo: pull requests from forks are skipped
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.forgejo/actions/linux-setup
with:
cache-key: ci
rust-components: clippy
- uses: ./.forgejo/actions/ci-run
# The quick subset of the release acceptance matrix (tools/acceptance.ts --quick: --version, init, check, scan, the
# desktop [Y/n] prompt answered n, mcp, a console plan, store --dry writes and confirm prompts answered n) from the
# packed npm tarball with real piped stdin, on Linux and Windows with Node 20. The full matrix gates the release.
acceptance-quick:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-22.04, platform: Linux }
- { os: windows, platform: Windows }
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Bun (Linux)
if: ${{ matrix.platform == 'Linux' }}
shell: bash
run: |
curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" >/dev/null
echo "$HOME/.bun/bin" >> "${FORGEJO_PATH:-$GITHUB_PATH}"
- name: Acceptance quick (Linux, Node 20)
if: ${{ matrix.platform == 'Linux' }}
shell: bash
run: bun tools/acceptance.ts run --runtime node --platform Linux --quick --jobs 4 --out acceptance/Linux-node20-quick.json
- name: Acceptance quick (Windows, Node 20)
if: ${{ matrix.platform == 'Windows' }}
shell: pwsh
run: |
bun tools/acceptance.ts run --runtime node --platform Windows --quick --jobs 3 --out acceptance/Windows-node20-quick.json
if ($LASTEXITCODE -ne 0) { throw "acceptance quick: red cells" }
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: acceptance-quick-${{ matrix.platform }}
path: acceptance/
retention-days: 14