Repository navigation
122 lines (115 loc) · 3.9 KB
/
Copy pathcli-tests.yml
File metadata and controls
122 lines (115 loc) · 3.9 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CLI tests
on:
pull_request:
paths:
- ".github/workflows/cli-tests.yml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/cli/**"
- "crates/metrics/**"
- "sdks/typescript/**"
- "docs/database/helix-db/start-here/quickstart.mdx"
push:
branches: [main]
paths:
- ".github/workflows/cli-tests.yml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/cli/**"
- "crates/metrics/**"
- "sdks/typescript/**"
- "docs/database/helix-db/start-here/quickstart.mdx"
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cli-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
jobs:
test:
name: Test (${{ matrix.os }})
if: github.event_name != 'schedule'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04-arm
- macos-latest
- windows-2025
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
cache-dependency-path: sdks/typescript/package-lock.json
- uses: dtolnay/rust-toolchain@1.97.1
with:
components: clippy, rustfmt
- run: npm ci --ignore-scripts --no-audit --no-fund
working-directory: sdks/typescript
- name: Validate locked workspace metadata
run: cargo metadata --locked --format-version 1 --no-deps
- name: Unit and binary integration tests
run: cargo test --locked -p helix-metrics -p helix-cli --all-targets
- name: Doc tests
if: runner.os == 'Linux'
run: cargo test --locked -p helix-metrics -p helix-cli --doc
- name: Clippy
if: runner.os == 'Linux'
run: cargo clippy --locked -p helix-metrics -p helix-cli --all-targets -- -D warnings
- name: Formatting
if: runner.os == 'Linux'
run: cargo fmt -p helix-metrics -p helix-cli -- --check
coverage:
name: Coverage (Ubuntu)
if: github.event_name != 'schedule'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
cache-dependency-path: sdks/typescript/package-lock.json
- uses: dtolnay/rust-toolchain@1.97.1
with:
components: llvm-tools-preview
- run: npm ci --ignore-scripts --no-audit --no-fund
working-directory: sdks/typescript
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Enforce 80% metrics line coverage
run: >-
cargo llvm-cov --locked -p helix-metrics --all-targets
--fail-under-lines 80 --lcov --output-path target/metrics-coverage.lcov
- name: Enforce 80% CLI line coverage
run: >-
cargo llvm-cov --locked -p helix-cli --all-targets
--ignore-filename-regex '(crates/cli/tests/|crates/cli/src/prompts.rs|crates/cli/src/commands/update.rs)'
--fail-under-lines 80 --lcov --output-path target/cli-coverage.lcov
- uses: actions/upload-artifact@v4
with:
name: cli-and-metrics-coverage
path: target/*-coverage.lcov
registry-smoke:
name: Published TypeScript SDK registry smoke
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-24.04-arm
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
- uses: dtolnay/rust-toolchain@1.97.1
- name: Install and execute pinned TypeScript SDK read/write requests
run: >-
cargo test --locked -p helix-cli --test typescript_runtime
registry_smoke_executes_exact_sdk_read_and_write
-- --ignored --exact --nocapture