macro_paste 1.1.5

Macros for all your token pasting needs. Maintained, drop-in replacement for paste.
Documentation
name: Rust CI/Unit Tests

on:
  push:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

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

env:
  RUSTFLAGS: "-Dwarnings"

jobs:
  pre_ci:
    uses: dtolnay/.github/.github/workflows/pre_ci.yml@master

  test:
    name: ${{ matrix.os }}, Rust ${{matrix.rust}}
    needs: pre_ci
    if: needs.pre_ci.outputs.continue
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        rust: [ nightly, beta, stable, 1.85.0 ]
        os: [ ubuntu-latest, macos-latest, windows-latest ]
    timeout-minutes: 45
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install Rust
        uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
        with:
          toolchain: ${{ matrix.rust }}
          override: true
          components: rustfmt

      - name: Enable type layout randomization
        run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
        if: matrix.rust == 'nightly'

      - name: Run tests (bless stderr on nightly)
        shell: bash
        run: |
          if [ "${{ matrix.rust }}" = "nightly" ]; then
            TRYBUILD=overwrite cargo test
          else
            cargo test
          fi

      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' && always()
        with:
          name: Cargo.lock
          path: Cargo.lock

      - name: Run cargo check with all features
        run: cargo check --all-features

      - name: Run cargo fmt
        run: cargo fmt --all -- --check

  coverage:
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: "-Cinstrument-coverage -Clink-dead-code -Coverflow-checks=off"
      LLVM_PROFILE_FILE: "coverage/%p-%m.profraw"
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - name: Set up Rust with coverage tools
        uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
        with:
          toolchain: stable
          override: true
          components: llvm-tools-preview
      - name: Install grcov
        run: |
          curl -LsSf https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar xj
          sudo mv grcov /usr/local/bin/
      - name: Run tests with coverage
        run: |
          cargo clean
          cargo build --tests
          cargo test
      - name: Generate coverage report
        run: |
          mkdir -p coverage
          grcov . \
            --binary-path ./target/debug/ \
            --source-dir . \
            --output-type lcov \
            --branch \
            --ignore-not-existing \
            --ignore "/*/.cargo/**" \
            --ignore "target/**" \
            --output-path coverage/lcov.info
      - name: Coveralls GitHub Action
        uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
        with:
          path-to-lcov: coverage/lcov.info

  doc:
    name: Documentation
    needs: pre_ci
    if: needs.pre_ci.outputs.continue
    runs-on: ubuntu-latest
    timeout-minutes: 45
    env:
      RUSTDOCFLAGS: -Dwarnings
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # nightly
      - uses: dtolnay/install@982daea0f5d846abc3c83e01a6a1d73c040047c1 # cargo-docs-rs
      - run: cargo docs-rs

  outdated:
    name: Outdated
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    timeout-minutes: 45
    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
      - uses: dtolnay/install@f0761f7aa894742cde7dec05963ea54ae2dfc4b5 # cargo-outdated
      - run: cargo outdated --workspace --exit-code 1