chore: release #134
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # v2 | |
| - run: cargo clippy --workspace --lib --bins -- -D warnings | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # v2 | |
| - run: cargo test --workspace | |
| msrv: | |
| name: MSRV (1.75) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.75" | |
| - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # v2 | |
| - run: cargo check --workspace | |
| # Proves the README "single static binary" claim continuously: build the mem4n6 | |
| # binary for musl and fail if it is not actually statically linked. The release | |
| # workflow ships these musl artifacts (release.yml). | |
| musl-static: | |
| name: Static musl binary | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| # Pin to rust-toolchain.toml's channel (1.96.0) so the musl target is added | |
| # to the SAME toolchain the build uses — a floating `stable` here adds the | |
| # target to the wrong toolchain and the pinned build fails with E0463. | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.96.0" | |
| targets: x86_64-unknown-linux-musl | |
| - uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609 # v2 | |
| - run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - run: cargo build --release --target x86_64-unknown-linux-musl --bin mem4n6 | |
| - name: Assert statically linked | |
| run: | | |
| BIN=target/x86_64-unknown-linux-musl/release/mem4n6 | |
| file "$BIN" | |
| # Accept both classic static and static-PIE (self-contained + ASLR) — both have no external deps. | |
| file "$BIN" | grep -qE 'statically linked|static-pie linked' || { echo "::error::mem4n6 is NOT statically linked"; exit 1; } | |
| ldd "$BIN" 2>&1 | grep -qiE 'not a dynamic executable|statically linked' || { echo "::error::ldd reports dynamic linkage"; exit 1; } |