forked from floneum/floneum
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (102 loc) · 3.43 KB
/
main.yml
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
name: Rust CI
on:
push:
branches:
- main
paths:
- interfaces/*/src/**
- interfaces/*/examples/**
- interfaces/*/Cargo.toml
- models/*/src/**
- models/*/examples/**
- models/*/Cargo.toml
- floneum/*/src/**
- floneum/*/examples/**
- floneum/*/Cargo.toml
- src/**
- .github/**
- Cargo.toml
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths:
- interfaces/*/src/**
- interfaces/*/examples/**
- interfaces/*/Cargo.toml
- models/*/src/**
- models/*/examples/**
- models/*/Cargo.toml
- floneum/*/src/**
- floneum/*/examples/**
- floneum/*/Cargo.toml
- src/**
- .github/**
- Cargo.toml
# workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
if: github.event.pull_request.draft == false
name: Check
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libayatana-appindicator3-dev libxdo-dev
- uses: actions/checkout@v4
- name: Check workspace
run: cargo check --all --examples --tests --features kalosm/language,kalosm/sound,kalosm/vision
test:
if: github.event.pull_request.draft == false
name: Test Suite
runs-on: ubuntu-latest
environment:
name: OPENAI_API_KEY
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libayatana-appindicator3-dev libxdo-dev
- uses: actions/checkout@v4
- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: cargo test --lib --bins --tests --examples --workspace --features kalosm/language,kalosm/sound,kalosm/vision
doc:
if: github.event.pull_request.draft == false
name: Docs
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libayatana-appindicator3-dev libxdo-dev
- uses: actions/checkout@v4
- run: cargo test --doc --workspace --features kalosm/language,kalosm/sound,kalosm/vision
fmt:
if: github.event.pull_request.draft == false
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: rustup component add rustfmt
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check
clippy:
if: github.event.pull_request.draft == false
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libayatana-appindicator3-dev libxdo-dev
- run: rustup component add clippy
- uses: actions/checkout@v4
- run: cargo clippy --workspace --examples --tests --features kalosm/language,kalosm/sound,kalosm/vision -- -D warnings