-
Notifications
You must be signed in to change notification settings - Fork 25
120 lines (111 loc) · 3.21 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
111
112
113
114
115
116
117
118
119
120
name: CI
env:
PROTOBUF_VER: 3.17.3
# Run on git push, PR, or manually from the Actions tab
on: [push, pull_request, workflow_dispatch]
jobs:
rustfmt:
name: Check formatting with rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- run: rustup component add rustfmt --toolchain nightly
- name: Run rustfmt
run: rustup run nightly ci/run_rustfmt.sh
pb-jelly-unit:
name: pb-jelly unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Run unit tests
run: |
cd pb-jelly
rustup run nightly cargo test
pb-jelly-gen-unit:
name: pb-jelly-gen unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Run unit tests
run: |
cd pb-jelly-gen
rustup run nightly cargo test
pbtest:
strategy:
matrix:
plat: [ubuntu-latest, macos-latest, windows-latest]
name: pbtest integration test (${{matrix.plat}})
runs-on: ${{matrix.plat}}
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run integration test
env:
VALIDATE: 1
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo test
examples:
name: examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
cd examples/examples_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo test
benchmarks:
name: benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run benchmark
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run --features=bench_prost,bench_rust_protobuf
cd ..
rustup run nightly cargo bench bench --features=bench_prost,bench_rust_protobuf
clippy_gen:
name: clippy gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- run: rustup component add clippy --toolchain nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy
env:
RUSTFLAGS: "-D warnings"
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo clippy -p proto_pbtest