Skip to content

Commit d542774

Browse files
committed
CI: run Rust checks, build and publish container image
We need to disable the test_router_api_willow_post() as that requires the STT model. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
1 parent ef83a16 commit d542774

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
tags: ["*"]
7+
8+
jobs:
9+
rust_checks:
10+
name: Rust checks
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- name: Clone repository
14+
uses: actions/checkout@v4
15+
- name: setup rust toolchain
16+
uses: dtolnay/rust-toolchain@1.92
17+
with:
18+
components: clippy,rustfmt
19+
- run: cargo fmt --check
20+
- name: install cargo-hack
21+
uses: taiki-e/install-action@cargo-hack
22+
- run: cargo hack clippy --all-targets --feature-powerset --group-features hf,stt --no-deps -- -Dclippy::pedantic
23+
- run: cargo hack test --all-targets --feature-powerset --group-features hf,stt
24+
25+
publish:
26+
needs: rust_checks
27+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
28+
runs-on: ubuntu-24.04
29+
permissions:
30+
packages: write
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
- uses: docker/build-push-action@v6
39+
with:
40+
file: Containerfile
41+
push: true
42+
tags: |
43+
ghcr.io/heywillow/willow-inference-server-rs:${{ github.ref_name }}
44+
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/heywillow/willow-inference-server-rs:latest') || '' }}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(clippy::doc_markdown)]
12
pub mod built_info {
23
include!(concat!(env!("OUT_DIR"), "/built.rs"));
34
}

tests/router_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mod tests {
1111
use wis_rs::{router::router, state::State};
1212

1313
#[cfg(feature = "stt")]
14+
#[ignore = "test requires STT model"]
1415
#[tokio::test]
1516
async fn test_router_api_willow_post() {
1617
const TESTDATA_FILE: &str = "tests/assets/whats_the_time.pcm";

0 commit comments

Comments
 (0)