chore: update libkrun with InvalidAscii panic fix #172
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] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| A3S_DEPS_STUB: "1" | |
| jobs: | |
| # ── Lint & Format ────────────────────────────────────────────── | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cd src && cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Install protoc | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Create stub libkrun | |
| run: | | |
| echo "void krun_stub(void) {}" > /tmp/krun_stub.c | |
| gcc -shared -o /tmp/libkrun.so /tmp/krun_stub.c | |
| sudo cp /tmp/libkrun.so /usr/lib/ | |
| sudo ldconfig | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src | |
| - run: cd src && cargo clippy --workspace --all-targets -- -D warnings | |
| # ── Tests (stub mode, no VM) ─────────────────────────────────── | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install protoc | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Create stub libkrun | |
| run: | | |
| echo "void krun_stub(void) {}" > /tmp/krun_stub.c | |
| gcc -shared -o /tmp/libkrun.so /tmp/krun_stub.c | |
| sudo cp /tmp/libkrun.so /usr/lib/ | |
| sudo ldconfig | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src | |
| - run: cd src && cargo test --workspace --lib | |
| # ── Build check (compile only, no artifacts) ──────────────────── | |
| build-check: | |
| name: Build Check (${{ matrix.target }}) | |
| needs: [fmt, clippy, test] | |
| strategy: | |
| matrix: | |
| include: | |
| - target: linux-x86_64 | |
| os: ubuntu-latest | |
| - target: linux-arm64 | |
| os: ubuntu-24.04-arm | |
| - target: macos-arm64 | |
| os: macos-14 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential pkg-config libssl-dev \ | |
| musl-tools libclang-dev protobuf-compiler | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install lld llvm protobuf | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src | |
| key: ${{ matrix.target }} | |
| - name: Check compilation | |
| run: | | |
| cd src | |
| cargo check --release -p a3s-box-cli -p a3s-box-shim | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| cargo check --release -p a3s-box-cri | |
| fi | |
| # ── SDK compile checks ───────────────────────────────────────── | |
| check-sdks: | |
| name: Check SDKs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install protoc | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Create stub libkrun | |
| run: | | |
| echo "void krun_stub(void) {}" > /tmp/krun_stub.c | |
| gcc -shared -o /tmp/libkrun.so /tmp/krun_stub.c | |
| sudo cp /tmp/libkrun.so /usr/lib/ | |
| sudo ldconfig | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src | |
| - name: Check Python SDK | |
| run: cd sdk/python && cargo check | |
| - name: Check Node SDK | |
| run: cd sdk/node && cargo check | |
| # ── Windows launcher build check ─────────────────────────────── | |
| build-windows: | |
| name: Build Windows Launcher | |
| needs: [fmt, clippy, test] | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Init submodules | |
| run: git -c http.extraheader= submodule update --init --recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src | |
| key: windows-launcher | |
| - name: Build Windows launcher | |
| working-directory: src/win-launcher | |
| run: cargo build --release --bin a3s-box-win --target x86_64-pc-windows-msvc | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: a3s-box-win | |
| path: src/target/x86_64-pc-windows-msvc/release/a3s-box-win.exe |