From 9d3d61ba6604cc97d90d097d293633e1fabebd3e Mon Sep 17 00:00:00 2001 From: Catty Steve <4795515+Catty2014@user.noreply.gitee.com> Date: Thu, 23 Apr 2026 16:30:51 +0800 Subject: [PATCH] ci: enable GitHub/Gitea worker --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 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..298a25a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [ master, main ] + paths: + - 'workshop-baker/**' + - '.github/workflows/ci.yml' + pull_request: + branches: [ master, main ] + paths: + - 'workshop-baker/**' + - '.github/workflows/ci.yml' + +env: + CARGO_TERM_COLOR: always + +jobs: + check-and-lint: + name: Check & Lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./workshop-baker + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Cache cargo dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Check code (cargo check) + run: cargo check --all-features + + - name: Run Clippy lints + run: cargo clippy --all-features -- -D warnings