From cc3d0301bc112ba57e3f280252f31a0483426fab Mon Sep 17 00:00:00 2001 From: Katie McKeon Date: Sat, 11 Jan 2025 23:33:47 +0000 Subject: [PATCH] start workflow defs with clippy + unit tests --- .github/workflows/ci.yaml | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..bb46185 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,56 @@ +name: CI Workflows + +on: + push: + branches: [ "main" ] + pull_request: + # Do not run on draft pull requests + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + lint-and-test: + runs-on: ubuntu-latest + # Do not run on draft pull requests + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + override: true + + - name: Cache cargo registry + uses: actions/cache@v2 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache cargo index + uses: actions/cache@v2 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-index- + + - name: Install Clippy + run: rustup component add clippy + + - name: Run Clippy + run: cargo clippy + + - name: Build + run: cargo build --verbose + + - name: Run sindri-rs unit tests + run: cargo test --package sindri-rs --lib --verbose