1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-18 06:56:13 +00:00

Ensure all tests run on all platforms without skipping

- Remove test skipping based on target availability
- Install cross-compilation toolchains for all platforms in CI:
  - Ubuntu: musl-tools
  - macOS: musl-cross with proper cargo config
  - Windows: rust-lld linker
- Update builder to use platform-appropriate linkers
- Make full build/run workflow test mandatory in CI
- Add Docker setup and local registry for integration tests
- Set RUSTFLAGS with --cfg ci to enable CI-specific test behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-07 21:17:30 -04:00
parent 93bb4561fc
commit 642472c548
Failed to extract signature
5 changed files with 71 additions and 23 deletions

View file

@ -8,6 +8,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "--cfg ci"
jobs:
test:
@ -23,6 +24,29 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: x86_64-unknown-linux-musl
- name: Install cross-compilation tools (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Install cross-compilation tools (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install musl-cross
# Set up cargo config for cross-compilation
mkdir -p ~/.cargo
echo '[target.x86_64-unknown-linux-musl]' >> ~/.cargo/config.toml
echo 'linker = "x86_64-linux-musl-gcc"' >> ~/.cargo/config.toml
- name: Install cross-compilation tools (Windows)
if: matrix.os == 'windows-latest'
run: |
# On Windows, we'll use rust-lld as the linker for musl targets
rustup component add llvm-tools-preview
# Create cargo config
mkdir -p ~/.cargo
echo '[target.x86_64-unknown-linux-musl]' >> ~/.cargo/config.toml
echo 'linker = "rust-lld"' >> ~/.cargo/config.toml
- name: Cache cargo registry
uses: actions/cache@v4
with:
@ -72,6 +96,12 @@ jobs:
integration:
name: Integration Test
runs-on: ubuntu-latest
needs: [test, fmt, clippy] # Only run after other tests pass
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4
- name: Install Rust
@ -82,6 +112,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build krust
run: cargo build --release
- name: Add krust to PATH