- Make CI smoke commands Windows-aware by using OS-neutral cargo run invocations - Replace masked negative smoke checks (|| true) with explicit non-zero assertions - Remove Cargo.lock from .gitignore and track for binary reproducibility - Strengthen secret redaction to eliminate stable first/last character leakage - Remove readme field from Cargo.toml that referenced a missing README.md
118 lines
3.2 KiB
YAML
118 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
fmt:
|
|
name: cargo fmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --check
|
|
|
|
clippy:
|
|
name: cargo clippy (${{ matrix.os }})
|
|
needs: [fmt]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- run: cargo clippy --all-targets -- -D warnings
|
|
|
|
test:
|
|
name: cargo test (${{ matrix.os }})
|
|
needs: [fmt]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo test --all-targets
|
|
|
|
build:
|
|
name: cargo build (${{ matrix.os }})
|
|
needs: [fmt]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo build
|
|
|
|
release-build:
|
|
name: cargo build --release (${{ matrix.os }})
|
|
needs: [test]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo build --release
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: rustunnel-${{ matrix.os }}
|
|
path: target/release/rustunnel${{ matrix.os == 'windows-latest' && '.exe' || '' }}
|
|
retention-days: 7
|
|
|
|
smoke:
|
|
name: CLI smoke (${{ matrix.os }})
|
|
needs: [release-build]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- run: cargo build --release
|
|
# OS-neutral cargo-based smoke tests avoid path issues on Windows (.exe vs no extension)
|
|
- name: rustunnel --help
|
|
run: cargo run --release -- --help
|
|
- name: rustunnel version
|
|
run: cargo run --release -- version
|
|
- name: rustunnel listen --help
|
|
run: cargo run --release -- listen --help
|
|
- name: rustunnel connect --help
|
|
run: cargo run --release -- connect --help
|
|
- name: rustunnel generate --help
|
|
run: cargo run --release -- generate --help
|
|
- name: Invalid command fails
|
|
run: |
|
|
if cargo run --release -- invalid-cmd 2>&1; then
|
|
echo "ERROR: invalid command should have failed"
|
|
exit 1
|
|
fi
|
|
- name: Invalid port fails
|
|
run: |
|
|
if cargo run --release -- listen --listen localhost:bad --cert x --key x --ca-cert x --auth-token x 2>&1; then
|
|
echo "ERROR: invalid port should have failed"
|
|
exit 1
|
|
fi
|