httpmock 0.8.3

HTTP mocking library for Rust
Documentation
on: workflow_dispatch

name: All Features Test

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  core-features-test:
    name: core-features-test
    runs-on: ubuntu-latest
    container:
      image: xd009642/tarpaulin:develop-nightly
      options: --security-opt seccomp=unconfined
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Trust custom CA certificates
        shell: bash
        run: |
          set -e
          cp certs/ca.pem certs/ca.crt
          apt-get update
          apt-get install -y ca-certificates
          cp certs/*.crt /usr/local/share/ca-certificates/
          update-ca-certificates

      - name: Run feature power set test
        run: make core-features-test

  advanced-features-test:
    name: advanced-features-test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Set up Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: Trust custom CA certificates
        shell: bash
        run: |
          set -euxo pipefail
          cp certs/ca.pem certs/ca.crt
          sudo apt-get update
          sudo apt-get install -y ca-certificates curl
          sudo cp certs/*.crt /usr/local/share/ca-certificates/
          sudo update-ca-certificates

      - name: Build httpmock standalone Docker image (all features)
        run: |
          docker build -t httpmock-standalone:local .

      - name: Run httpmock server container
        env:
          HTTPMOCK_PORT: "5050"
        run: |
          docker run -d --rm \
            --name httpmock \
            -p 5050:5050 \
            -e RUST_LOG \
            -e HTTPMOCK_PORT \
            httpmock-standalone:local

      - name: Wait for httpmock readiness
        shell: bash
        run: |
          set -euxo pipefail
          for i in {1..60}; do
            if curl -fsS http://localhost:5050/__httpmock__/ping >/dev/null; then
              echo "httpmock is ready"; exit 0; fi
            sleep 1
          done
          echo "httpmock did not become ready in time" >&2; docker logs httpmock || true; exit 1

      - name: Run feature power set test
        env:
          HTTPMOCK_TESTS_DISABLE_SIMULATED_STANDALONE_SERVER: "1"
          RUST_LOG: httpmock=info,hyper=info
        run: |
          make advanced-features-test

      - name: Show httpmock logs on failure
        if: failure()
        run: |
          docker logs httpmock || true

      - name: Stop httpmock container
        if: always()
        run: |
          docker rm -f httpmock || true