index : rust-template
Feature rich rust template
about summary refs log tree commit diff

Diffstat (limited to '.github/workflows/ci.yml')

-rw-r--r-- .github/workflows/ci.yml 35
 1 file changed, 35 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..4f50659 100644
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -1,0 +1,35 @@
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  ci:
    name: Check, Lint & Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --all -- --check

      - name: Lint with Clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Build
        run: cargo build --all-targets --verbose

      - name: Run tests
        run: cargo test --all-targets --all-features --verbose