xml-sec 0.1.9

Pure Rust XML Security: XMLDSig, XMLEnc, C14N. Drop-in replacement for libxmlsec1.
Documentation
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -Dwarnings
  XMLSEC1_VERSION: 1.3.12
  XMLSEC1_SHA256: 24045199af12d93fe5fdbbbf7e386e823e4842071e9432e2b90ac108b889a923

jobs:
  build-matrix:
    name: build-matrix (${{ matrix.rust }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [stable, "1.92.0"]
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.rust }}
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --all-features

  build:
    runs-on: ubuntu-latest
    needs: build-matrix
    if: ${{ always() }}
    steps:
      - run: test "${{ needs.build-matrix.result }}" = "success"

  test-matrix:
    name: test-matrix (${{ matrix.rust }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        rust: [stable, "1.92.0"]
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ matrix.rust }}
      - uses: taiki-e/install-action@nextest
      - name: Refresh apt package index
        run: sudo apt-get update
      - name: Build pinned xmlsec1 for XMLDSig interop tests
        run: |
          sudo apt-get install --yes build-essential libltdl-dev libssl-dev libxml2-dev pkg-config
          curl --fail --location --retry 3 --output xmlsec1.tar.gz "https://github.com/lsh123/xmlsec/releases/download/${XMLSEC1_VERSION}/xmlsec1-${XMLSEC1_VERSION}.tar.gz"
          echo "${XMLSEC1_SHA256}  xmlsec1.tar.gz" | sha256sum --check --strict
          tar --extract --file xmlsec1.tar.gz
          pushd "xmlsec1-${XMLSEC1_VERSION}"
          ./configure --disable-static --with-openssl
          make --jobs "$(nproc)"
          sudo make install
          popd
          sudo ldconfig
          xmlsec1 --version
      - uses: Swatinem/rust-cache@v2
      - run: cargo nextest run --all-features
      - run: cargo test --doc --all-features

  test:
    runs-on: ubuntu-latest
    needs: test-matrix
    if: ${{ always() }}
    steps:
      - run: test "${{ needs.test-matrix.result }}" = "success"

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-features --all-targets -- -D warnings

  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all -- --check