Add test-all.sh script for comprehensive feature testing and automate workflows

This commit is contained in:
geoffsee
2025-08-28 14:06:50 -04:00
parent b0d37194fe
commit 9818998379
13 changed files with 1073 additions and 350 deletions

View File

@@ -10,30 +10,8 @@ env:
jobs:
docs:
name: Build and validate documentation
name: Build and validate documentation (test-all.sh quick)
runs-on: ubuntu-latest
defaults:
run:
working-directory: crates/hyper-custom-cert
strategy:
fail-fast: false
matrix:
include:
- name: default-features
features: ""
no-default-features: false
- name: no-default-features
features: ""
no-default-features: true
- name: rustls
features: "rustls"
no-default-features: true
- name: insecure-dangerous
features: "insecure-dangerous"
no-default-features: false
- name: all-features
features: "rustls,insecure-dangerous"
no-default-features: true
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -51,59 +29,17 @@ jobs:
- name: Setup Rust
run: rustup update stable && rustup default stable
- name: Build documentation
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
cargo doc $FLAGS --no-deps
- name: Ensure test-all.sh is executable
run: chmod +x ./scripts/test-all.sh
- name: Check documentation warnings
- name: Run test-all.sh (quick mode)
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo doc $FLAGS --no-deps"
RUSTDOCFLAGS="-D warnings" cargo doc $FLAGS --no-deps
- name: Test documentation examples
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo test --doc $FLAGS"
cargo test --doc $FLAGS
run: ./scripts/test-all.sh --quick
test:
name: Test before release
name: Test before release (test-all.sh)
runs-on: ubuntu-latest
needs: docs
defaults:
run:
working-directory: crates/hyper-custom-cert
strategy:
fail-fast: false
matrix:
include:
- name: default (native-tls)
features: ""
no-default-features: false
- name: no-default-features (no TLS)
features: ""
no-default-features: true
- name: rustls
features: "rustls"
no-default-features: true
- name: insecure-dangerous (native-tls)
features: "insecure-dangerous"
no-default-features: false
- name: rustls + insecure-dangerous
features: "rustls,insecure-dangerous"
no-default-features: true
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -127,23 +63,15 @@ jobs:
- name: Cargo fmt (check)
run: cargo fmt --all -- --check
- name: Clippy
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo clippy --all-targets $FLAGS -- -D warnings"
cargo clippy --all-targets $FLAGS -- -D warnings
- name: Clippy (default)
run: cargo clippy --all-targets -- -D warnings
- name: Tests
- name: Ensure test-all.sh is executable
run: chmod +x ./scripts/test-all.sh
- name: Run comprehensive test suite
shell: bash
run: |
FLAGS=""
if [ "${{ matrix.no-default-features }}" = "true" ]; then FLAGS="$FLAGS --no-default-features"; fi
if [ -n "${{ matrix.features }}" ]; then FLAGS="$FLAGS --features ${{ matrix.features }}"; fi
echo "Running: cargo test $FLAGS -- --nocapture"
cargo test $FLAGS -- --nocapture
run: ./scripts/test-all.sh
publish: