Repository navigation
121 lines (112 loc) · 4.03 KB
/
Copy pathci.yml
File metadata and controls
121 lines (112 loc) · 4.03 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
name: CI
on:
pull_request:
branches: [develop, main]
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace --all-targets
# Issue #175: the embedder/mobile checks only cover tole-core's
# --no-default-features profile, so the tole-cli no-mcp host profile
# drifted uncompilable invisibly (feature-gated command paths
# referencing gated-out items). Keep it compiling AND warning-free —
# a drift here means a cfg gate is wrong somewhere. Issue #310: also
# check tole-core's integration tests in --no-default-features (they
# silently stopped compiling there once).
no-mcp:
name: no-mcp profile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
key: no-mcp
- run: |
# #330: the bare profile (neither shell-tools nor mcp) must compile too.
cargo check -p tole-cli --no-default-features
cargo test -p tole-cli --no-default-features
cargo check -p tole-cli --no-default-features --features shell-tools
cargo clippy -p tole-cli --no-default-features --features shell-tools -- -D warnings
cargo test -p tole-cli --no-default-features --features shell-tools
cargo check -p tole-core --no-default-features --tests
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-targets -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace
# Compile the release profile — catches optimizer-only errors that the
# dev-profile Check job misses (uteke parity; required check on main).
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --workspace --release
# E9 embedder/mobile profile: tole-core must keep compiling for the
# mobile targets with --no-default-features (no subprocess tools, no
# MCP). Check-only — no link, no device. Android additionally needs
# the NDK clang for bundled sqlite (the cc crate); ubuntu runners ship
# the NDK, we just point the cc env vars at the newest one.
cross-compile:
name: Cross-Compile (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: aarch64-apple-ios
- os: ubuntu-latest
target: aarch64-linux-android
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Point cc at the preinstalled Android NDK
if: matrix.target == 'aarch64-linux-android'
run: |
NDK_BIN="$(ls -d /usr/local/lib/android/sdk/ndk/* | sort -V | tail -1)/toolchains/llvm/prebuilt/linux-x86_64/bin"
echo "CC_aarch64_linux_android=$NDK_BIN/aarch64-linux-android24-clang" >> "$GITHUB_ENV"
echo "AR_aarch64_linux_android=$NDK_BIN/llvm-ar" >> "$GITHUB_ENV"
- run: cargo check -p tole-core --target ${{ matrix.target }} --no-default-features