ggen 1.2.0

ggen is a deterministic, language-agnostic code generation framework that treats software artifacts as projections of knowledge graphs.
Documentation
name: Test

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

env:
  CARGO_TERM_COLOR: always

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    strategy:
      matrix:
        rust: [stable, beta]

    steps:
      - uses: actions/checkout@v5

      - name: Install Rust ${{ matrix.rust }}
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}

      - name: Cache cargo registry
        uses: actions/cache@v4
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo index
        uses: actions/cache@v4
        with:
          path: ~/.cargo/git
          key: ${{ runner.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo build
        uses: actions/cache@v4
        with:
          path: target
          key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo-make
        uses: actions/cache@v4
        with:
          path: ~/.cargo/bin/cargo-make
          key: ${{ runner.os }}-cargo-make

      - name: Install cargo-make
        run: cargo install cargo-make --locked --force

      - name: Run unit tests
        run: cargo test --lib

      - name: Run integration tests
        run: cargo test --test cli --test marketplace --test e2e_github_integration --test e2e_lockfile_sha256 --test e2e_marketplace --test e2e_pqc_infrastructure --test e2e_production_marketplace

      - name: Run BDD tests
        run: cargo test --test bdd

      - name: Generate BDD report
        run: cargo test --test bdd -- --nocapture

      - name: Upload BDD results
        uses: actions/upload-artifact@v4
        with:
          name: bdd-results-${{ matrix.rust }}
          path: target/bdd-report.xml

      - name: Run examples
        run: cargo run --example cli-subcommand