forked from spiceai/spiceai
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.31 KB
/
integration_search.yml
File metadata and controls
74 lines (65 loc) · 2.31 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
---
name: integration tests (search)
on:
schedule:
- cron: '0 1 * * *' # Daily at 01:00 UTC
workflow_dispatch:
inputs:
update_snapshots:
description: 'Update the snapshots?'
required: false
default: 'no'
type: choice
options:
- 'always'
- 'no'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'trunk' && github.sha || 'any-sha' }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
# CI performance optimizations
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_NET_RETRY: 10
CARGO_HTTP_TIMEOUT: 60
jobs:
test-search:
name: Test Search Integration
runs-on: spiceai-macos
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
ref: ${{ github.sha }}
fetch-depth: 1
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up API Keys
run: |
echo 'SPICE_OPENAI_API_KEY="${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}"' > .env
- name: Run search integration tests
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
AWS_S3_VECTORS_KEY: ${{ secrets.AWS_S3_VECTORS_KEY }}
AWS_S3_VECTORS_SECRET: ${{ secrets.AWS_S3_VECTORS_SECRET }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
cargo test --test integration_models -p runtime --features models,metal,s3_vectors,kafka,duckdb,extended_tests -- search || {
if [ "$INSTA_UPDATE" == "always" ]; then
echo "Warning: Tests failed but INSTA_UPDATE is enabled. Continuing."
exit 0
else
exit 1
fi
}
- name: Push snapshots to branch
if: github.event.inputs.update_snapshots == 'always' || github.event_name == 'schedule'
uses: ./.github/actions/push-snap-changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: 'fix: Update Search integration test snapshots'