From 542b0ab029e4ab401f05b534831a686be3690557 Mon Sep 17 00:00:00 2001 From: Fankouzu Date: Sat, 21 Feb 2026 02:50:10 +0800 Subject: [PATCH] ci: add github actions workflow for go and rust components --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..95b9b2d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + go-cli: + name: Go CLI + runs-on: ubuntu-latest + defaults: + run: + working-directory: cli + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + cache-dependency-path: cli/go.sum + - name: Download dependencies + run: go mod download + - name: Build + run: go build ./... + - name: Test + run: go test -race ./... + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + working-directory: cli + + rust-gui: + name: Rust GUI + runs-on: ubuntu-latest + defaults: + run: + working-directory: gui + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + with: + workspaces: gui + - name: Check formatting + run: cargo fmt --all -- --check + - name: Clippy + run: cargo clippy --all-targets --all-features -- -D warnings + - name: Build + run: cargo build --all-features + - name: Test + run: cargo test --all-features