-
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.5 KB
/
ci.yml
File metadata and controls
64 lines (51 loc) · 1.5 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
name: CI
on:
pull_request:
branches: [main, develop]
# Optionally, allow manual trigger for debugging
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup workspace dependencies
shell: bash
run: |
chmod +x scripts/setup-workspace.sh
./scripts/setup-workspace.sh
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.91.0
components: rustfmt, clippy
- name: Show Rust versions
run: |
rustc --version
cargo --version
rustfmt --version
- name: Cache Rust dependencies and build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Run lint checks and tests
if: matrix.os != 'windows-latest'
run: ./lint.sh --check --test
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: cargo test --all-features --verbose
- name: Build
run: cargo build --all-features --verbose