name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
cancel-in-progress: true
env:
CARGO_PROFILE_DEV_DEBUG: 0
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Typo check
uses: crate-ci/typos@v1.40.0
- name: Verify published recipe fragments
run: python3 script/check-ai docs
- uses: oven-sh/setup-bun@v2
- name: gpui-pre is pinned exactly
run: bun script/check-gpui-pin.ts
- uses: taiki-e/install-action@v2
with:
tool: cargo-machete@0.9.1
- name: Machete
run: cargo machete
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Lint
run: cargo clippy --workspace --exclude gpui-shell --locked -- --deny warnings
no-default-features:
name: No default features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
- name: Check without default features (tree-sitter disabled)
run: cargo check -p gpui-component --no-default-features --locked
- name: Test without default features
run: python3 script/check-ai rust
test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
run_on: macos-latest
- target: x86_64-linux-gnu
run_on: ubuntu-latest
- target: x86_64-windows-msvc
run_on: windows-latest
runs-on: ${{ matrix.run_on }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Leave the example crates to the lint job
run: |
excludes=$(cargo metadata --no-deps --format-version 1 | jq -j '
((.workspace_root | gsub("\\\\"; "/")) + "/examples/") as $examples
| .packages[]
| select((.manifest_path | gsub("\\\\"; "/")) | startswith($examples))
| select(.name != "gpui-kit-recipes")
| "--exclude \(.name) "')
echo "TEST_EXCLUDES=$excludes" >> "$GITHUB_ENV"
- name: Test
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES
- name: Doc tests
if: ${{ matrix.run_on == 'macos-latest' }}
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES --doc
- name: Metal UI rendering tests
if: ${{ matrix.run_on == 'macos-latest' }}
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES --test rendering
gpui-shell-core:
name: GPUI Shell Core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-shell-release
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
- name: Test runtime core without standard-library integration cases
run: |
cargo test -p gpui-shell --release --lib -- \
--skip tests::standard_runtime \
--skip tests::network \
--skip tests::fs \
--skip tests::process \
--skip tests::benchmark
cargo test -p gpui-shell --release tests::benchmark
cargo test -p gpui-shell --release --doc
- name: Lint GPUI Shell
run: cargo clippy -p gpui-shell --all-targets -- -D warnings
gpui-component-shell:
name: GPUI Component Shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
- name: Test component bindings
run: cargo test -p gpui-component-shell --all-targets
- name: Verify generated TypeScript contracts
run: |
npm --prefix crates/component-shell/tests/types ci
npm --prefix crates/component-shell/tests/types test
- name: Lint component bindings
run: cargo clippy -p gpui-component-shell --all-targets -- -D warnings
- name: Verify story coverage against the component inventory
run: node examples/js_story/fixtures/verify-coverage.mjs
gpui-shell-standard-runtime:
name: GPUI Shell Standard Runtime (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
run_on: macos-latest
- target: x86_64-linux-gnu
run_on: ubuntu-latest
- target: x86_64-windows-msvc
run_on: windows-latest
runs-on: ${{ matrix.run_on }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-shell-release
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Test LLRT module integration
run: |
cargo test -p gpui-shell --release tests::standard_runtime
cargo test -p gpui-shell --release tests::fs
cargo test -p gpui-shell --release tests::process
cargo test -p gpui-shell --release tests::network
cargo test -p gpui-shell --release tests::render
cargo test -p gpui-shell --release tests::snapshot
cargo test -p gpui-shell --release tests::host_api
cargo test -p gpui-shell --release tests::http_request