chezmoi_modify_manager 2.2.0

Chezmoi addon to patch ini files with mixed settings and state (experimental rust branch)
Documentation
name: Build

permissions:
  contents: read

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

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  modern-default:
    # Test modern compilers on standard platforms on Linux.
    name: "Test: ${{ matrix.target }}, Rust ${{ matrix.rust }} (default configuration)"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          - aarch64-unknown-linux-gnu
          - aarch64-unknown-linux-musl
          - armv7-unknown-linux-gnueabihf
          - armv7-unknown-linux-musleabihf
          - i686-unknown-linux-gnu
          - i686-unknown-linux-musl
          - x86_64-pc-windows-gnu
          - x86_64-unknown-linux-gnu
          - x86_64-unknown-linux-musl
        rust:
          - stable
          - nightly
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup install --profile minimal ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - name: Install cross
        uses: taiki-e/install-action@cross
      - name: Cache builds
        uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}
      - name: Cross compile and test
        run: cross test --locked --target ${{ matrix.target }} --verbose

  configurations:
    # Test non-standard configurations, MSRV and Rust versions
    name: "Test: \"${{ matrix.features }}\" (Linux), Rust ${{ matrix.rust }}"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        features:
          - --no-default-features
          - --no-default-features --features=updater-tls-native
          - --no-default-features --features=updater-tls-native-vendored
          - --no-default-features --features=updater-tls-rusttls
        rust:
          - 1.70.0
          - stable
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup install --profile minimal  ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - name: Cache builds
        uses: Swatinem/rust-cache@v2
        with:
          save-if: ${{ matrix.features == '--no-default-features --features=updater-tls-native-vendored' }}
      - name: Compile and test
        run: cargo test --locked ${{ matrix.features }} --verbose

  exotic-linux:
    # Test exotic Linux configs that only work with vendored OpenSSL
    name: "Test: ${{ matrix.target }}, Rust ${{ matrix.rust }} (vendored OpenSSL)"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        target:
          - i586-unknown-linux-gnu
          - powerpc-unknown-linux-gnu
          - powerpc64-unknown-linux-gnu
          - riscv64gc-unknown-linux-gnu
        rust:
          - stable
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup install --profile minimal  ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
      - name: Install cross
        uses: taiki-e/install-action@cross
      - name: Cache builds
        uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}
      - name: Cross compile and test
        run: cross test --locked --no-default-features --features=updater-tls-native-vendored --target ${{ matrix.target }} --verbose

  exotic-os:
    # Test native builds on non-Linux platforms
    name: "Test: ${{ matrix.target }} on ${{ matrix.os }} with stable rust"
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-pc-windows-msvc
            os: windows-latest
          - target: x86_64-apple-darwin
            os: macos-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust
        run: rustup install --profile minimal stable && rustup default stable
      - name: Cache builds
        uses: Swatinem/rust-cache@v2
      - name: Compile and test
        run: cargo test --locked --target ${{ matrix.target }} --verbose