-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (50 loc) · 1.3 KB
/
test.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
name: Cargo Build & Test
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
crate:
- instruct-macros
- instructor
steps:
- uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cd ${{ matrix.crate }} && cargo build --verbose
test:
name: Test Rust project - latest
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
crate:
- instruct-macros
- instructor
steps:
- uses: actions/checkout@v4
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-nextest
run: cargo install cargo-nextest --locked
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cd ${{ matrix.crate }} && cargo nextest run --verbose --retries 3
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}