Skip to content

Feature/static collections 118 #114

Feature/static collections 118

Feature/static collections 118 #114

name: Capability Engine Tests
on:
push:
branches: [ main, resource-implementation ]
pull_request:
branches: [ main ]
env:
RUST_BACKTRACE: 1
jobs:
test-matrix:
name: Test ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: "Default"
features: ""
package: "wrtd"
- name: "QM"
features: "qm"
package: "wrtd"
- name: "ASIL-A"
features: "asil-a"
package: "wrtd"
- name: "ASIL-B"
features: "asil-b"
package: "wrtd"
- name: "Minimal"
features: "--no-default-features"
package: "wrtd"
no_default: true
- name: "Runtime STD"
features: "std"
package: "wrt-runtime"
- name: "Runtime Alloc"
features: "alloc"
package: "wrt-runtime"
- name: "WRT QM"
features: "qm"
package: "wrt"
- name: "WRT ASIL-A"
features: "asil-a"
package: "wrt"
- name: "WRT ASIL-B"
features: "asil-b"
package: "wrt"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build ${{ matrix.name }}
run: |
if [ "${{ matrix.no_default }}" = "true" ]; then
cargo build -p ${{ matrix.package }} --no-default-features
elif [ "${{ matrix.features }}" = "" ]; then
cargo build -p ${{ matrix.package }}
else
cargo build -p ${{ matrix.package }} --features ${{ matrix.features }}
fi
- name: Clippy ${{ matrix.name }}
run: |
if [ "${{ matrix.no_default }}" = "true" ]; then
cargo clippy -p ${{ matrix.package }} --no-default-features -- -D warnings
elif [ "${{ matrix.features }}" = "" ]; then
cargo clippy -p ${{ matrix.package }} -- -D warnings
else
cargo clippy -p ${{ matrix.package }} --features ${{ matrix.features }} -- -D warnings
fi
- name: Test ${{ matrix.name }}
if: matrix.package != 'wrtd'
run: |
if [ "${{ matrix.features }}" = "" ]; then
cargo test -p ${{ matrix.package }} capability
else
cargo test -p ${{ matrix.package }} --features ${{ matrix.features }} capability
fi
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
- name: Install wat2wasm
run: |
curl -sSL https://github.com/WebAssembly/wabt/releases/download/1.0.34/wabt-1.0.34-ubuntu.tar.gz | tar xz
echo "$PWD/wabt-1.0.34/bin" >> $GITHUB_PATH
- name: Run capability integration tests
run: cargo test -p wrt capability_integration_tests -- --nocapture
- name: Run build matrix script
run: ./scripts/test_build_matrix.sh
summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test-matrix, integration-tests]
if: always()
steps:
- name: Summary
run: |
if [ "${{ needs.test-matrix.result }}" = "success" ] && [ "${{ needs.integration-tests.result }}" = "success" ]; then
echo "✅ All capability engine tests passed!"
exit 0
else
echo "❌ Some capability engine tests failed"
exit 1
fi