-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.49 KB
/
test.yml
File metadata and controls
47 lines (44 loc) · 1.49 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
name: Test 🧪
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: Run tests 🦀
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
- uses: Swatinem/rust-cache@v2
- name: Patch agent-core to git dep
run: |
sed -i 's|agent-core = { path = "../../../agent-core" }|agent-core = { git = "https://github.com/omnidotdev/agent-core" }|' Cargo.toml
sed -i '/^\[patch\."https:\/\/github\.com\/omnidotdev\/agent-core\.git"\]/,/^$/d' Cargo.toml
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test
version-check:
name: Version sync 📦
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check version sync
run: |
PKG_VERSION=$(jq -r '.version' package.json)
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
if [ "$PKG_VERSION" != "$CARGO_VERSION" ]; then
echo "::error::Version mismatch: package.json=$PKG_VERSION, Cargo.toml=$CARGO_VERSION"
exit 1
fi
echo "Versions match: $PKG_VERSION"