refactor(core): decouple from specific runtime #1603
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| tags: ["v*"] | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - '.github/**' | |
| - 'README.md' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| style: | |
| name: Style | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Style check | |
| run: cargo fmt --all -- --check | |
| - name: Clippy check | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| docs: | |
| name: Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Build docs | |
| run: cargo doc --document-private-items --all-features | |
| hack: | |
| name: Hack | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-hack from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: cargo-hack | |
| - name: Run hack script | |
| run: cargo hack check --each-feature | |
| msrv: | |
| name: MSRV | |
| needs: [style] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Resolve MSRV aware dependencies | |
| run: cargo update | |
| env: | |
| CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback | |
| - name: Get MSRV package metadata | |
| id: metadata | |
| run: cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' >> $GITHUB_OUTPUT | |
| - name: Install rust (${{ steps.metadata.outputs.msrv }}) | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ steps.metadata.outputs.msrv }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check | |
| run: cargo check | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature-set: | |
| - "--all-features" | |
| - "--no-default-features" | |
| - "--no-default-features --features webpki-roots" | |
| - "--no-default-features --features form" | |
| - "--no-default-features --features query" | |
| - "--features cookies" | |
| - "--features gzip,stream" | |
| - "--features brotli,stream" | |
| - "--features zstd,stream" | |
| - "--features deflate,stream" | |
| - "--features json" | |
| - "--features multipart" | |
| - "--features stream" | |
| - "--features hickory-dns" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Run tests (${{ matrix.feature-set }}) | |
| run: cargo nextest run --workspace ${{ matrix.feature-set }} | |
| build: | |
| name: Build (${{ matrix.env }}) | |
| runs-on: ${{ matrix.os }} | |
| environment: ${{ matrix.env }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| env: Linux | |
| - os: windows-latest | |
| env: Windows | |
| - os: macos-latest | |
| env: macOS | |
| - os: ubuntu-latest | |
| env: Android | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Install NASM (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: choco install nasm -y | |
| - name: Build | |
| if: matrix.env != 'Android' | |
| run: cargo build --all-features | |
| - name: Add Android targets | |
| if: matrix.env == 'Android' | |
| run: rustup target add aarch64-linux-android x86_64-linux-android | |
| - uses: nttld/setup-ndk@v1.6.0 | |
| if: matrix.env == 'Android' | |
| id: setup-ndk | |
| with: | |
| ndk-version: r27c | |
| add-to-path: true | |
| - name: Build with cargo-ndk | |
| if: matrix.env == 'Android' | |
| env: | |
| ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| run: | | |
| cargo install cargo-ndk | |
| cargo ndk -t arm64-v8a -t x86_64 build --all-features | |
| release: | |
| name: Release | |
| needs: [style, test, docs, hack, msrv, build] | |
| runs-on: ubuntu-latest | |
| environment: Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - uses: katyo/publish-crates@v2 | |
| with: | |
| registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| ignore-unpublished-changes: true | |
| - name: Upload binaries to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }} | |
| generate_release_notes: true |