rsurl 0.0.1

A pure-Rust implementation of curl. Library, C FFI, and CLI for HTTP/HTTPS/FTP/FTPS.
Documentation
name: CI

on:
  push:
    branches: [master]
  pull_request:

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test & lint (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v6

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Cache
        uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.os }}

      - name: Format
        if: runner.os == 'Linux' # formatting is platform-independent
        run: cargo fmt --all --check

      - name: Clippy (all features, warnings denied)
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Test (all features, release)
        # `--release` so the integration tests in tests/ (which spin up a
        # local HTTP/1.1 server and round-trip real bytes through rsurl)
        # exercise the same code paths CI ships. The unit tests are cheap
        # enough that running them in release adds no meaningful time.
        run: cargo test --release --all-features

  c_abi:
    name: C ABI smoke test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache
        uses: Swatinem/rust-cache@v2

      - name: Build the C library (static + shared)
        run: |
          cargo rustc --lib --release --crate-type staticlib
          cargo rustc --lib --release --crate-type cdylib

      - name: Compile and run the C smoke test (static link)
        run: |
          cc tests/ffi_smoke.c -I include target/release/librsurl.a \
             -lpthread -ldl -lm -o ffi_smoke_static
          ./ffi_smoke_static

      - name: Compile and run the C smoke test (shared link)
        # Same source, linked against the cdylib instead of the staticlib.
        # LD_LIBRARY_PATH points the loader at target/release so the
        # binary can find librsurl.so at run time without installing it.
        run: |
          cc tests/ffi_smoke.c -I include \
             -L target/release -lrsurl \
             -o ffi_smoke_shared
          LD_LIBRARY_PATH=target/release ./ffi_smoke_shared

  docs:
    name: Docs build (warnings denied)
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings -D rustdoc::broken-intra-doc-links
    steps:
      - uses: actions/checkout@v6

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache
        uses: Swatinem/rust-cache@v2

      - name: cargo doc --no-deps --all-features
        run: cargo doc --no-deps --all-features