From 851abcae57346c98d030b5da5cc5b5c296a4dcad Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Mon, 25 Nov 2024 15:33:55 +0000 Subject: [PATCH 1/3] feat: add proto check and make directives Signed-off-by: Mike Nguyen --- .github/workflows/ci.yml | 8 +++++++- Makefile | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d58807..6e78b1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,14 +37,20 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} - uses: actions/checkout@v4 + + - name: Check compiled protos for a diff + run: | + make proto-gen check-diff-proto + - name: cargo fmt run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }} + - name: cargo clippy run: cargo clippy build: - name: Build on rust-${{ matrix.rust-version}} + name: Test and Build on rust-${{ matrix.rust-version}} runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..81071b1 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: proto-gen +proto-gen: + cargo run --bin proto-gen + +.PHONY: check-diff-proto +check-diff-proto: + git diff --exit-code ./proto/ \ No newline at end of file From ae9bcda712c25cc4561d41e8937eaa994587133f Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Mon, 25 Nov 2024 15:43:05 +0000 Subject: [PATCH 2/3] ci: rename steps Signed-off-by: Mike Nguyen --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e78b1f..05a0ffd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ env: jobs: lint: - name: Lint + name: Check and Lint runs-on: ubuntu-latest steps: @@ -78,7 +78,7 @@ jobs: run: cargo test --workspace --all-targets --all-features test-docs-sdk: - name: Docs SDK + name: Check Docs - dapr runs-on: ubuntu-latest env: RUSTDOCFLAGS: -Dwarnings @@ -89,7 +89,7 @@ jobs: - run: cargo docs-rs -p dapr test-docs-macros: - name: Docs Macros + name: Check Docs - dapr-macros runs-on: ubuntu-latest env: RUSTDOCFLAGS: -Dwarnings From e15f65b4355c08ff6e2d294a30060401b416e17c Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Mon, 25 Nov 2024 15:51:58 +0000 Subject: [PATCH 3/3] ci: refactor doc test Signed-off-by: Mike Nguyen --- .github/workflows/ci.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a0ffd..e5eada3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: build: - name: Test and Build on rust-${{ matrix.rust-version}} + name: Test and Build on rust-${{ matrix.rust-version }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -77,32 +77,27 @@ jobs: - name: Run Tests run: cargo test --workspace --all-targets --all-features - test-docs-sdk: - name: Check Docs - dapr + test-docs: + name: Check Docs - ${{ matrix.crate }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: + - dapr + - dapr-macros env: RUSTDOCFLAGS: -Dwarnings steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/install@cargo-docs-rs - - run: cargo docs-rs -p dapr - - test-docs-macros: - name: Check Docs - dapr-macros - runs-on: ubuntu-latest - env: - RUSTDOCFLAGS: -Dwarnings - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly - - uses: dtolnay/install@cargo-docs-rs - - run: cargo docs-rs -p dapr-macros + - run: cargo docs-rs -p ${{ matrix.crate }} publish: name: Publish runs-on: ubuntu-latest - needs: [test-docs-sdk, test-docs-macros, lint, build] + needs: [test-docs, lint, build] if: startswith(github.ref, 'refs/tags/v') steps: