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