gh-workflow 0.8.1

A type-safe GitHub Actions workflow generator
Documentation
name: CI
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
jobs:
  build:
    name: Build and Test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        rust: [stable, beta, nightly]
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true
      - name: Install Dependencies
        run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
      - name: Cache Cargo registry
        uses: actions/cache@v3
        with:
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
          path: ~/.cargo/registry
          restore-keys: |
            ${{ runner.os }}-cargo-registry-
      - name: Cache Cargo build
        uses: actions/cache@v3
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-build-
      - name: Build project
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
      - name: Run clippy (optional)
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: Run fmt check (optional)
        run: cargo fmt -- --check