compose-lens 0.1.0

Loss-aware parsing, processing, validation, and rendering of Compose projects
Documentation
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

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

env:
  CARGO_TERM_COLOR: always

jobs:
  rust:
    name: Rust quality
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - &checkout
        name: Check out repository
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - name: Install configured Rust toolchain
        run: rustup show active-toolchain
      - name: Check formatting
        run: cargo fmt --all -- --check
      - name: Check all targets
        run: cargo ci-check
      - name: Check repository policies
        run: cargo ci-policy
      - name: Run Clippy
        run: cargo ci-clippy
      - name: Run tests
        run: cargo ci-test
      - name: Run documentation tests
        run: cargo ci-doctest
      - name: Build documentation
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo ci-doc
      - name: Verify release package
        run: cargo ci-package

  msrv:
    name: MSRV
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    steps:
      - *checkout
      - name: Read the workspace MSRV
        id: metadata
        shell: bash
        run: |
          msrv="$(
            cargo metadata --locked --no-deps --format-version 1 |
              jq -er '[.packages[].rust_version] | unique | if length == 1 and .[0] != null then .[0] else error("workspace packages must declare one common rust-version") end'
          )"
          printf 'msrv=%s\n' "$msrv" >> "$GITHUB_OUTPUT"
      - name: Install minimum supported Rust
        env:
          RUST_MSRV: ${{ steps.metadata.outputs.msrv }}
        run: rustup toolchain install "${RUST_MSRV}" --profile minimal
      - name: Check all targets with the MSRV
        env:
          RUST_MSRV: ${{ steps.metadata.outputs.msrv }}
        run: cargo "+${RUST_MSRV}" ci-check
      - name: Check repository policies with the MSRV
        env:
          RUST_MSRV: ${{ steps.metadata.outputs.msrv }}
        run: cargo "+${RUST_MSRV}" ci-policy

  dependencies:
    name: Dependency and license policy
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    steps:
      - *checkout
      - name: Audit dependencies, licenses, bans, and sources
        uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
        with:
          command: check
          arguments: --all-features

  documentation:
    name: Documentation
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    steps:
      - *checkout
      - name: Lint Markdown
        uses: DavidAnson/markdownlint-cli2-action@6bf21b07787794f89a243495939cd651942aeabe # v24.1.0
        with:
          globs: "**/*.md"
      - name: Check links
        uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
        with:
          args: >-
            --root-dir '${{ github.workspace }}' --no-progress --max-retries 2
            --retry-wait-time 2 --accept '100..=103,200..=299,429'
            --exclude-path '(^|/)target/' './**/*.md'
          fail: true
          token: ${{ secrets.GITHUB_TOKEN }}