|
1 | | -name: Test And Build |
2 | | - |
3 | | -on: |
4 | | - schedule: |
5 | | - # Run nightly at 2:00 AM UTC |
6 | | - - cron: '0 2 * * *' |
7 | | - workflow_dispatch: # Allow manual triggering |
8 | | - pull_request: # Run on all pull requests |
9 | | - |
10 | | -jobs: |
11 | | - test-and-build: |
12 | | - runs-on: ubuntu-latest |
13 | | - |
14 | | - steps: |
15 | | - - name: Check out the repo |
16 | | - uses: actions/checkout@v4 |
17 | | - |
18 | | - - name: Set up Rust |
19 | | - uses: dtolnay/rust-toolchain@stable |
20 | | - with: |
21 | | - toolchain: 1.85 |
22 | | - |
23 | | - - name: Set up Go |
24 | | - uses: actions/setup-go@v5 |
25 | | - with: |
26 | | - go-version: '1.24' |
27 | | - |
28 | | - - name: Install system dependencies |
29 | | - run: | |
30 | | - sudo apt-get update |
31 | | - sudo apt-get install -y \ |
32 | | - make \ |
33 | | - build-essential \ |
34 | | - pkg-config |
35 | | -
|
36 | | - - name: Cache Rust dependencies |
37 | | - uses: actions/cache@v4 |
38 | | - with: |
39 | | - path: | |
40 | | - ~/.cargo/bin/ |
41 | | - ~/.cargo/registry/index/ |
42 | | - ~/.cargo/registry/cache/ |
43 | | - ~/.cargo/git/db/ |
44 | | - candle-binding/target/ |
45 | | - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} |
46 | | - restore-keys: | |
47 | | - ${{ runner.os }}-cargo- |
48 | | -
|
49 | | - - name: Cache Go dependencies |
50 | | - uses: actions/cache@v4 |
51 | | - with: |
52 | | - path: | |
53 | | - ~/go/pkg/mod |
54 | | - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
55 | | - restore-keys: | |
56 | | - ${{ runner.os }}-go- |
57 | | -
|
58 | | - - name: Cache Models |
59 | | - uses: actions/cache@v4 |
60 | | - with: |
61 | | - path: | |
62 | | - models/ |
63 | | - key: ${{ runner.os }}-models-v1-${{ hashFiles('tools/make/models.mk') }} |
64 | | - restore-keys: | |
65 | | - ${{ runner.os }}-models-v1- |
66 | | -
|
67 | | - - name: Check go mod tidy |
68 | | - run: make check-go-mod-tidy |
69 | | - |
70 | | - - name: Build Rust library |
71 | | - run: make rust |
72 | | - |
73 | | - - name: Install HuggingFace CLI |
74 | | - run: | |
75 | | - pip install -U "huggingface_hub[cli]" |
76 | | -
|
77 | | - - name: Download models |
78 | | - run: make download-models |
79 | | - |
80 | | - - name: Run semantic router tests |
81 | | - run: make test |
82 | | - env: |
83 | | - CGO_ENABLED: 1 |
84 | | - LD_LIBRARY_PATH: ${{ github.workspace }}/candle-binding/target/release |
85 | | - |
86 | | - - name: Upload test artifacts on failure |
87 | | - if: failure() |
88 | | - uses: actions/upload-artifact@v4 |
89 | | - with: |
90 | | - name: test-logs |
91 | | - path: | |
92 | | - **/*.log |
93 | | - **/test-output.* |
94 | | - retention-days: 7 |
95 | | - |
96 | | - - name: Notify on failure |
97 | | - if: failure() |
98 | | - run: | |
99 | | - echo "::error::Test and build failed. Check the workflow run for details." |
100 | | -
|
101 | | - # Trigger Docker publishing on successful nightly runs |
102 | | - publish-docker: |
103 | | - needs: test-and-build |
104 | | - if: success() && github.event_name == 'schedule' |
105 | | - uses: ./.github/workflows/docker-publish.yml |
106 | | - with: |
107 | | - tag_suffix: nightly-$(date +'%Y%m%d') |
108 | | - is_nightly: true |
109 | | - secrets: inherit |
| 1 | +name: Test And Build |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run nightly at 2:00 AM UTC |
| 6 | + - cron: "0 2 * * *" |
| 7 | + workflow_dispatch: # Allow manual triggering |
| 8 | + pull_request: # Run on all pull requests |
| 9 | + |
| 10 | +jobs: |
| 11 | + test-and-build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Check out the repo |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Set up Rust |
| 19 | + uses: dtolnay/rust-toolchain@stable |
| 20 | + with: |
| 21 | + toolchain: 1.85 |
| 22 | + |
| 23 | + - name: Set up Go |
| 24 | + uses: actions/setup-go@v5 |
| 25 | + with: |
| 26 | + go-version: "1.24" |
| 27 | + |
| 28 | + - name: Install system dependencies |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo apt-get install -y \ |
| 32 | + make \ |
| 33 | + build-essential \ |
| 34 | + pkg-config |
| 35 | +
|
| 36 | + - name: Cache Rust dependencies |
| 37 | + uses: actions/cache@v4 |
| 38 | + with: |
| 39 | + path: | |
| 40 | + ~/.cargo/bin/ |
| 41 | + ~/.cargo/registry/index/ |
| 42 | + ~/.cargo/registry/cache/ |
| 43 | + ~/.cargo/git/db/ |
| 44 | + candle-binding/target/ |
| 45 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-cargo- |
| 48 | +
|
| 49 | + - name: Cache Go dependencies |
| 50 | + uses: actions/cache@v4 |
| 51 | + with: |
| 52 | + path: | |
| 53 | + ~/go/pkg/mod |
| 54 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 55 | + restore-keys: | |
| 56 | + ${{ runner.os }}-go- |
| 57 | +
|
| 58 | + - name: Cache Models |
| 59 | + uses: actions/cache@v4 |
| 60 | + with: |
| 61 | + path: | |
| 62 | + models/ |
| 63 | + key: ${{ runner.os }}-models-v1-${{ hashFiles('tools/make/models.mk') }} |
| 64 | + restore-keys: | |
| 65 | + ${{ runner.os }}-models-v1- |
| 66 | +
|
| 67 | + - name: Check go mod tidy |
| 68 | + run: make check-go-mod-tidy |
| 69 | + |
| 70 | + - name: Build Rust library |
| 71 | + run: make rust |
| 72 | + |
| 73 | + - name: Install HuggingFace CLI |
| 74 | + run: | |
| 75 | + pip install -U "huggingface_hub[cli]" |
| 76 | +
|
| 77 | +
|
| 78 | + - name: Download models (minimal on PRs) |
| 79 | + env: |
| 80 | + CI_MINIMAL_MODELS: ${{ github.event_name == 'pull_request' }} |
| 81 | + HF_HUB_ENABLE_HF_TRANSFER: 1 |
| 82 | + HF_HUB_DISABLE_TELEMETRY: 1 |
| 83 | + run: make download-models |
| 84 | + |
| 85 | + - name: Run semantic router tests |
| 86 | + run: make test |
| 87 | + env: |
| 88 | + CGO_ENABLED: 1 |
| 89 | + LD_LIBRARY_PATH: ${{ github.workspace }}/candle-binding/target/release |
| 90 | + |
| 91 | + - name: Upload test artifacts on failure |
| 92 | + if: failure() |
| 93 | + uses: actions/upload-artifact@v4 |
| 94 | + with: |
| 95 | + name: test-logs |
| 96 | + path: | |
| 97 | + **/*.log |
| 98 | + **/test-output.* |
| 99 | + retention-days: 7 |
| 100 | + |
| 101 | + - name: Notify on failure |
| 102 | + if: failure() |
| 103 | + run: | |
| 104 | + echo "::error::Test and build failed. Check the workflow run for details." |
| 105 | +
|
| 106 | + # Trigger Docker publishing on successful nightly runs |
| 107 | + publish-docker: |
| 108 | + needs: test-and-build |
| 109 | + if: success() && github.event_name == 'schedule' |
| 110 | + uses: ./.github/workflows/docker-publish.yml |
| 111 | + with: |
| 112 | + tag_suffix: nightly-$(date +'%Y%m%d') |
| 113 | + is_nightly: true |
| 114 | + secrets: inherit |
0 commit comments