From bd510ed7db76df5c7937cb493688f20a7e43fa51 Mon Sep 17 00:00:00 2001 From: Walter Pinto Date: Sat, 10 Oct 2026 09:36:59 +0100 Subject: [PATCH] ci(rust): use the shared format and build-and-test composite actions The Go and Markdown format checks and the build-then-test steps are the same on every language; they now come from .github/actions/format-check and .github/actions/please-build-test on main, so a change to them never edits this file. Everything specific to Rust stays here: its own formatter steps, setup, build targets and coverage smoke tests. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci-rust.yml | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 595daf8..9aeeed4 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -14,22 +14,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v5 - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.23" - - - name: Check Go formatting - run: | - if [ -d tools ]; then - UNFORMATTED=$(gofmt -l tools/) - if [ -n "$UNFORMATTED" ]; then - echo "The following Go files are not formatted:" - echo "$UNFORMATTED" - echo "Run 'gofmt -w tools/' to fix." - exit 1 - fi - fi + - name: Check formatting + uses: ./.github/actions/format-check - name: Install rustfmt uses: dtolnay/rust-toolchain@stable @@ -42,14 +28,6 @@ jobs: find test -name "*.rs" -exec rustfmt --check {} + fi - - name: Set up Node.js - uses: actions/setup-node@v5 - with: - node-version: "20" - - - name: Check Markdown formatting - run: npx prettier --check "**/*.md" - test: name: Please Build & Test (Rust) runs-on: ubuntu-latest @@ -57,11 +35,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v5 - - name: Build all targets - run: ./pleasew --plain_output build //tools/please_rust/... //tools/rust_toolchain/... //test/rust/... - - - name: Run all tests - run: ./pleasew --plain_output test //... + - name: Build and test + uses: ./.github/actions/please-build-test + with: + build-targets: //tools/please_rust/... //tools/rust_toolchain/... //test/rust/... - name: Coverage smoke test (lib_test) run: |