246a876568
* feat: dockerize rust protobuf generation in make and CI Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6438cfba-52ed-4c85-b8fe-1268cc55755a Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com> * fix: unify make all and CI generation with local builder image Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6438cfba-52ed-4c85-b8fe-1268cc55755a Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com> * fix: only use custom Docker image for rust target, go/java/cpp use protoc-all directly Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6e6885ee-2919-46f5-9dc5-301c3303888d Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com> * chore: fix README wording and add --user flag to rust docker run Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/3983f532-e5e5-45e4-953d-27bc551ec13d Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com> * fix: make cargo/rustup dirs world-writable so --user flag works in container Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/1bddab48-992c-481b-937f-6698dd9cc067 Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
92 lines
2.4 KiB
YAML
92 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
RUST_TOOLCHAIN: stable
|
|
|
|
jobs:
|
|
typos:
|
|
name: Spell Check with Typos
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: crate-ci/typos@master
|
|
|
|
check:
|
|
name: Check
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24.3"
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Run cargo check
|
|
run: cargo check --workspace --all-targets
|
|
- name: Generate protobuf
|
|
run: |
|
|
make all
|
|
- name: Check protobuf generation
|
|
run: |
|
|
git diff --quiet || (echo "Fail: generated go protobuf in github action is different from pushed ones, please run 'make all'"; exit 1)
|
|
|
|
proto-fmt:
|
|
name: Protobuf Format
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Buf
|
|
uses: bufbuild/buf-action@v1
|
|
with:
|
|
setup_only: true
|
|
- name: Run Buf Format
|
|
run: buf format --diff --exit-code
|
|
|
|
fmt:
|
|
name: Rustfmt
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
components: rustfmt
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Run cargo fmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
components: clippy
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: Run cargo clippy
|
|
run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr
|