Repository navigation
148 lines (136 loc) · 4.68 KB
/
Copy pathci.yml
File metadata and controls
148 lines (136 loc) · 4.68 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
fmt:
name: Rustfmt
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check formatting
run: cargo fmt --all --check
clippy:
name: Clippy
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
test:
name: Test
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run tests
run: cargo test --workspace --locked
coverage:
name: Coverage
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Generate coverage summary
run: cargo llvm-cov --workspace --locked --json --summary-only --output-path coverage-summary.json --fail-under-lines 88
- name: Update coverage badge data
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
percent="$(jq -r '.data[0].totals.lines.percent' coverage-summary.json)"
rounded="$(printf '%.2f' "$percent")"
color="$(awk -v p="$percent" 'BEGIN {
if (p >= 90) print "brightgreen";
else if (p >= 80) print "green";
else if (p >= 70) print "yellow";
else if (p >= 60) print "orange";
else print "red";
}')"
mkdir -p badges
jq -n \
--arg label "coverage" \
--arg message "${rounded}%" \
--arg color "$color" \
'{schemaVersion: 1, label: $label, message: $message, color: $color}' \
> badges/coverage.json
if git diff --quiet -- badges/coverage.json; then
echo "Coverage badge is up to date: ${rounded}%"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add badges/coverage.json
git commit -m "Update coverage badge"
git push
docs_and_scripts:
name: Documentation and setup scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check documentation links and setup script tests
run: |
python3 scripts/check-doc-links.py
python3 -m unittest discover -s scripts/tests -v
for script in scripts/*.sh; do bash -n "$script"; done
source_install:
name: Source install and real-model smoke test
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install service from source
run: cargo install --locked --path crates/aximo --root "$RUNNER_TEMP/aximo-install"
- name: Download default model
run: ./scripts/fetch-models.sh
- name: Verify installed service with real inference
env:
AXIMO_CONFIG: config/aximo.local.toml
AXIMO_SERVER_PORT: "18080"
ORT_LOG: error
run: |
"$RUNNER_TEMP/aximo-install/bin/aximo" > service.log 2>&1 &
service_pid=$!
trap 'kill "$service_pid" 2>/dev/null || true; wait "$service_pid" 2>/dev/null || true' EXIT
ready=false
for attempt in $(seq 1 120); do
if ! kill -0 "$service_pid" 2>/dev/null; then
cat service.log
exit 1
fi
if curl --fail --silent http://127.0.0.1:18080/health/ready > /dev/null; then
ready=true
break
fi
sleep 2
done
if [ "$ready" != true ]; then
cat service.log
exit 1
fi
python3 scripts/smoke-test.py --base-url http://127.0.0.1:18080
- name: Upload service startup log
if: failure()
uses: actions/upload-artifact@v7
with:
name: source-install-service-log
path: service.log
if-no-files-found: ignore