Skip to content

Commit 1ac0191

Browse files
authored
Merge pull request #248 from mikeee/check-proto-diff
feat: add proto check and make directives
2 parents fcff470 + c4675a6 commit 1ac0191

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222

2323
jobs:
2424
lint:
25-
name: Lint
25+
name: Check and Lint
2626
runs-on: ubuntu-latest
2727

2828
steps:
@@ -37,14 +37,20 @@ jobs:
3737
repo-token: ${{ secrets.GITHUB_TOKEN }}
3838
version: ${{ env.PROTOC_VERSION }}
3939
- uses: actions/checkout@v4
40+
41+
- name: Check compiled protos for a diff
42+
run: |
43+
make proto-gen check-diff-proto
44+
4045
- name: cargo fmt
4146
run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }}
47+
4248
- name: cargo clippy
4349
run: cargo clippy
4450

4551

4652
build:
47-
name: Build on rust-${{ matrix.rust-version}}
53+
name: Test and Build on rust-${{ matrix.rust-version }}
4854
runs-on: ubuntu-latest
4955
strategy:
5056
fail-fast: false
@@ -71,32 +77,27 @@ jobs:
7177
- name: Run Tests
7278
run: cargo test --workspace --all-targets --all-features
7379

74-
test-docs-sdk:
75-
name: Docs SDK
76-
runs-on: ubuntu-latest
77-
env:
78-
RUSTDOCFLAGS: -Dwarnings
79-
steps:
80-
- uses: actions/checkout@v4
81-
- uses: dtolnay/rust-toolchain@nightly
82-
- uses: dtolnay/install@cargo-docs-rs
83-
- run: cargo docs-rs -p dapr
84-
85-
test-docs-macros:
86-
name: Docs Macros
80+
test-docs:
81+
name: Check Docs - ${{ matrix.crate }}
8782
runs-on: ubuntu-latest
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
crate:
87+
- dapr
88+
- dapr-macros
8889
env:
8990
RUSTDOCFLAGS: -Dwarnings
9091
steps:
9192
- uses: actions/checkout@v4
9293
- uses: dtolnay/rust-toolchain@nightly
9394
- uses: dtolnay/install@cargo-docs-rs
94-
- run: cargo docs-rs -p dapr-macros
95+
- run: cargo docs-rs -p ${{ matrix.crate }}
9596

9697
publish:
9798
name: Publish
9899
runs-on: ubuntu-latest
99-
needs: [test-docs-sdk, test-docs-macros, lint, build]
100+
needs: [test-docs, lint, build]
100101
if: startswith(github.ref, 'refs/tags/v')
101102

102103
steps:

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: proto-gen
2+
proto-gen:
3+
cargo run --bin proto-gen
4+
5+
.PHONY: check-diff-proto
6+
check-diff-proto:
7+
git diff --exit-code ./proto/

0 commit comments

Comments
 (0)