hocon-parser 1.6.0

Full Lightbend HOCON specification-compliant parser for Rust
Documentation
name: Test
on:
  push:
    branches: [master, develop, main]
  pull_request:
    branches: [master, develop, main]

jobs:
  test:
    strategy:
      matrix:
        rust: [stable, "1.82"]
        os: [ubuntu-latest]
        include:
          - rust: stable
            os: macos-latest
          - rust: stable
            os: windows-latest
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
      # Cache is split into restore+save so the save key is content-addressable
      # via the post-fetch hash of `.xx-hocon-version`. On a fresh checkout,
      # `.xx-hocon-version` is gitignored and absent at restore time, so the
      # restore step relies on `restore-keys` to match the most recent entry.
      # (closes #101)
      - name: Restore expected JSON cache
        uses: actions/cache/restore@v5
        with:
          path: |
            tests/testdata/expected
            .xx-hocon-version
          key: xx-hocon-expected-pending
          restore-keys: xx-hocon-expected-
      - name: Fetch expected JSON
        run: make testdata
      # Default `if: success()` — skip the save if `make testdata` failed so
      # we don't write a partial/missing-pin cache under the empty-hash key
      # (which would collapse to the constant `xx-hocon-expected-` and
      # recreate the bug this PR is fixing). Copilot review thread.
      - name: Save expected JSON cache
        uses: actions/cache/save@v5
        with:
          path: |
            tests/testdata/expected
            .xx-hocon-version
          key: xx-hocon-expected-${{ hashFiles('.xx-hocon-version') }}
      - run: cargo test
        if: matrix.rust == 'stable'
      # MSRV: remove criterion dev-dependency before testing because
      # criterion's transitive dep clap_lex requires edition 2024
      - name: Remove bench deps for MSRV
        if: matrix.rust != 'stable'
        run: |
          sed -i '/\[dev-dependencies\]/,/^\[/{/criterion/d}' Cargo.toml
          sed -i '/\[\[bench\]\]/,/^$/d' Cargo.toml
      - run: cargo test
        if: matrix.rust != 'stable'
      - run: cargo test --features serde
        if: matrix.rust == 'stable'

  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
      # Cache is split into restore+save so the save key is content-addressable
      # via the post-fetch hash of `.xx-hocon-version`. On a fresh checkout,
      # `.xx-hocon-version` is gitignored and absent at restore time, so the
      # restore step relies on `restore-keys` to match the most recent entry.
      # (closes #101)
      - name: Restore expected JSON cache
        uses: actions/cache/restore@v5
        with:
          path: |
            tests/testdata/expected
            .xx-hocon-version
          key: xx-hocon-expected-pending
          restore-keys: xx-hocon-expected-
      - name: Fetch expected JSON
        run: make testdata
      # Default `if: success()` — skip the save if `make testdata` failed so
      # we don't write a partial/missing-pin cache under the empty-hash key
      # (which would collapse to the constant `xx-hocon-expected-` and
      # recreate the bug this PR is fixing). Copilot review thread.
      - name: Save expected JSON cache
        uses: actions/cache/save@v5
        with:
          path: |
            tests/testdata/expected
            .xx-hocon-version
          key: xx-hocon-expected-${{ hashFiles('.xx-hocon-version') }}
      - uses: taiki-e/install-action@cargo-llvm-cov
      - run: cargo llvm-cov --features serde --lcov --output-path lcov.info
      - uses: codecov/codecov-action@v5
        with:
          files: lcov.info
          token: ${{ secrets.CODECOV_TOKEN }}
          slug: ${{ github.repository }}
          fail_ci_if_error: false