forked from 0xPlaygrounds/rig
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (110 loc) · 3.63 KB
/
ci.yaml
File metadata and controls
132 lines (110 loc) · 3.63 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
# Inspired by https://github.com/joshka/github-workflows/blob/main/.github/workflows/rust-check.yml
name: Lint & Test
on:
pull_request:
branches:
- "**"
merge_group:
workflow_call:
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.91.0
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
fmt:
name: stable / fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
toolchain: ${{ env.RUST_VERSION }}
- name: Run cargo fmt
run: cargo fmt -- --check
# Special check to make sure rig-core is compatible with the wasm target
check-wasm:
name: stable / check rig-core wasm target
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown
toolchain: ${{ env.RUST_VERSION }}
- name: Run cargo check wasm target
run: cargo check --package rig-core --features wasm --target wasm32-unknown-unknown
clippy:
name: stable / clippy
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
toolchain: ${{ env.RUST_VERSION }}
# Required to compile rig-lancedb
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Run clippy action
uses: clechasseur/rs-clippy-check@v3
with:
args: --all-features --all-targets
test:
name: stable / test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Install nextest
uses: taiki-e/install-action@v2
with:
tool: nextest
# Required to compile rig-lancedb
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Test with latest nextest release
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --all-features --retries 2
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY }}
doc:
name: stable / doc
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rust-docs
toolchain: ${{ env.RUST_VERSION }}
# Required to compile rig-lancedb
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Run cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings