Repository navigation
103 lines (99 loc) · 5.31 KB
/
Copy pathfunction-components.yml
File metadata and controls
103 lines (99 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Function components
on:
pull_request:
branches: [main]
paths-ignore:
- docs/**
- '**/*.md'
- .agents/**
push:
branches: [main]
paths-ignore:
- docs/**
- '**/*.md'
- .agents/**
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name == 'pull_request' && 'pr' || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
CARGO_INCREMENTAL: "0"
jobs:
components:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-24.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.98.0
with:
components: clippy
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-rake-ci
cache-all-crates: false
cache-workspace-crates: false
shared-key: function-components-${{ matrix.os }}
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential pkg-config libssl-dev libasound2-dev libudev-dev \
libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libx11-dev \
libxcb-shape0-dev libxcb-xfixes0-dev libxcb-randr0-dev libxcb-xinput-dev \
libegl1-mesa-dev libgles2-mesa-dev libglib2.0-dev libfontconfig-dev \
mesa-vulkan-drivers xvfb fonts-dejavu-core
- name: Test runtime and inspection
run: >-
cargo test -p rake-gpui --features experimental-reactive,view-test-support,devtools --lib --locked
- name: Test consumer behavior
run: cargo test -p rake-app --locked --features experimental-reactive,view-test-support,devtools --test function_components --test view --test view_components --test view_state
- name: Check component consumers and targets
run: |
cargo clippy -p rake-app --locked --features experimental-reactive,view-test-support,devtools --lib --test function_components --bench function_components --example components -- -D warnings
cargo check -p renamed-facade --locked --features experimental-reactive,framework/view-test-support
cargo check -p rake-view --locked --all-targets --features rake/experimental-reactive,rake/view-test-support
cargo test -p rake-view-syntax -p rake-macros -p rake-protocol --locked --features rake-macros/reactive
cargo test -p rake-view-syntax --locked
cargo test -p rake-gpui --locked --features experimental-reactive,view-test-support --doc
cargo check -p rake-app -p renamed-facade --locked --features rake-app/experimental-reactive,renamed-facade/experimental-reactive --target wasm32-unknown-unknown --lib
cargo check -p rake-app --locked --features view-test-support --lib
cargo check -p rake-app -p rake-macros --locked --no-default-features --lib
- name: Check AppKit backend compatibility
if: runner.os == 'macOS'
run: |
cargo check -p rake-app --locked --features experimental-reactive,view-test-support,native-components --example native
cargo check -p rake-native --locked --features gpui-fast,native-tests,gpui_fast_platform/runtime_shaders,gpui_platform/runtime_shaders --test appkit
- name: Run headless benchmarks and lifetime assertions
if: github.event_name == 'workflow_dispatch'
run: cargo bench -p rake-app --locked --features experimental-reactive,view-test-support --bench function_components -- --quick
- name: Smoke-test native windows
if: github.event_name == 'workflow_dispatch'
shell: python
run: |
import json, os, signal, subprocess
build = subprocess.run(["cargo", "bench", "-p", "rake-app", "--locked", "--features", "experimental-reactive,view-test-support", "--bench", "function_components", "--no-run", "--message-format=json"], text=True, capture_output=True, check=True)
artifacts = [json.loads(line) for line in build.stdout.splitlines() if line.startswith("{")]
binary = next(item["executable"] for item in artifacts if item.get("target", {}).get("name") == "function_components" and item.get("executable"))
prefix = ["xvfb-run", "-a"] if os.environ["RUNNER_OS"] == "Linux" else []
for variant in ["plain", "plain-cached", "signals", "cached", "raw"]:
process = subprocess.Popen(prefix + [binary, "--native", variant], text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, start_new_session=True)
try:
stdout, stderr = process.communicate(timeout=60)
except subprocess.TimeoutExpired:
os.killpg(process.pid, signal.SIGKILL)
process.communicate()
raise
rows = [json.loads(line) for line in stdout.splitlines() if line.startswith("{")]
assert process.returncode == 0 and len(rows) == 1 and rows[0]["samples"] == 60, stdout + stderr
print(stdout, end="")