-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (41 loc) · 1.31 KB
/
test.yaml
File metadata and controls
44 lines (41 loc) · 1.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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable, msrv]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Determine Rust version
id: rust-version
run: |
if [ "${{ matrix.rust }}" = "msrv" ]; then
MSRV=$(grep '^rust-version' Cargo.toml | sed 's/.*"\(.*\)"/\1/')
echo "toolchain=${MSRV}" >> "$GITHUB_OUTPUT"
else
echo "toolchain=${{ matrix.rust }}" >> "$GITHUB_OUTPUT"
fi
- uses: dtolnay/rust-toolchain@stable # Action's stable branch. No SHA pinning - repo doesn't publish releases.
with:
toolchain: ${{ steps.rust-version.outputs.toolchain }}
- name: Install protoc (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf
- name: Run tests
run: cargo test --all-features
- name: Run doc tests
run: cargo test --doc --all-features