simplify container runtime support in snapshots (#73) #368
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: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| rust-fmt: | |
| name: Rust Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| targets: wasm32-wasip2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Generate AOT stub | |
| run: ./scripts/aot-stub.sh | |
| - name: Build WASM component | |
| run: cargo build --release --target wasm32-wasip2 -p wasi-component | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| rust-core-tests: | |
| name: Rust Core Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip2 | |
| - name: Generate AOT stub | |
| run: ./scripts/aot-stub.sh | |
| - name: Build WASM component | |
| run: cargo build --release --target wasm32-wasip2 -p wasi-component | |
| - name: Run cargo test | |
| run: cargo test --all --verbose | |
| build-snapshot: | |
| name: Build Default Snapshot | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install bsdtar | |
| run: sudo apt-get update && sudo apt-get install -y libarchive-tools | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.14.0 | |
| - name: Build Default Snapshot | |
| run: ./scripts/build-default-snapshot.sh | |
| python-sdk-integration: | |
| name: Python SDK Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip2 | |
| - name: Generate AOT stub | |
| run: ./scripts/aot-stub.sh | |
| - name: Build WASM library | |
| run: cargo build --release --target wasm32-wasip2 -p wasi-component --lib | |
| - name: Copy WASM to SDK | |
| run: cp target/wasm32-wasip2/release/vpod_wasi_lib.wasm sdks/python/vpod/ | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| working-directory: sdks/python | |
| run: pip install -e .[dev] | |
| - name: Run integration tests | |
| working-directory: sdks/python | |
| env: | |
| VPOD_REGISTRY: https://registry.vpod.sh/tests/v1/snapshots.json | |
| run: pytest tests/ -v -m integration | |