-
Notifications
You must be signed in to change notification settings - Fork 134
102 lines (91 loc) · 2.49 KB
/
cicd.yaml
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
name: CI/CD
on:
push:
paths-ignore:
- 'docs/**'
- 'website/**'
branches:
- main
pull_request:
paths-ignore:
- 'docs/**'
- 'website/**'
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
format_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup install stable
- run: rustup update
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: warn
command: check
build_and_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
rust-version: [stable]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Cache Rust Dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ matrix.os }}-cargo-
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust-version }}
override: true
- name: Install Protobuf Compiler (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install Protobuf Compiler (macOS)
if: matrix.os == 'macos-13'
run: brew install protobuf
- name: Install Protobuf Compiler (Windows)
if: matrix.os == 'windows-latest'
run: choco install protoc --yes
- name: Build (no default-features)
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Run tests (no default-features)
uses: actions-rs/cargo@v1
with:
command: test
args: --all --no-default-features
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features