pic-protocol 0.1.6

PIC Protocol - Provenance Identity Continuity Protocol
Documentation
# Copyright 2025 Nitro Agility S.r.l.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build-and-lint:
    if: ${{ !github.event.pull_request.draft }}
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-Dwarnings"
      RUSTDOCFLAGS: "-Dwarnings"
    steps:
      - name: Checkout PIC Protocol
        uses: actions/checkout@v4

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

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2
        with:
          cache-on-failure: "true"

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

      - name: Build workspace
        run: cargo build --workspace

      - name: Clippy lints
        run: cargo clippy --workspace -- -D warnings

      - name: Run tests
        run: cargo test --workspace

      - name: Generate docs
        run: cargo doc --no-deps --workspace --all-features

  test-features:
    if: ${{ !github.event.pull_request.draft }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout PIC Protocol
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2
        with:
          cache-on-failure: "true"

      - name: Test each feature combination
        run: cargo hack test --each-feature --workspace