Add README capability badges #48
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: | |
| jobs: | |
| rust: | |
| name: rust crate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: install rust toolchain | |
| run: | | |
| rustup update stable | |
| rustup default stable | |
| rustup target add wasm32-unknown-unknown | |
| - name: cargo test (native) | |
| run: cargo test --manifest-path crates/dhamaka-runtime/Cargo.toml | |
| - name: build wasm | |
| run: crates/dhamaka-runtime/build.sh | |
| - name: upload wasm artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dhamaka-runtime-wasm | |
| path: packages/hub/public/runtime/dhamaka-runtime.wasm | |
| if-no-files-found: error | |
| js: | |
| name: js (node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| needs: rust | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ["20", "22"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: download wasm artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dhamaka-runtime-wasm | |
| path: packages/hub/public/runtime | |
| - name: install workspace links | |
| run: npm install | |
| - name: syntax check | |
| run: | | |
| find packages -name '*.js' -not -path '*/node_modules/*' \ | |
| | xargs -n1 node --check | |
| - name: run tests | |
| run: npm test | |
| - name: smoke test dev server | |
| run: | | |
| node packages/playground/server.js & | |
| SERVER_PID=$! | |
| sleep 2 | |
| for url in \ | |
| "http://localhost:5174/" \ | |
| "http://localhost:5174/hub.js" \ | |
| "http://localhost:5174/manifest.json" \ | |
| "http://localhost:5174/runtime/dhamaka-runtime.wasm" \ | |
| "http://localhost:5173/" \ | |
| "http://localhost:5173/sdk/index.js" \ | |
| "http://localhost:5173/runtime/index.js"; do | |
| code=$(curl -s -o /dev/null -w "%{http_code}" "$url") | |
| if [ "$code" != "200" ]; then | |
| echo "FAIL: $url returned $code" | |
| kill $SERVER_PID 2>/dev/null || true | |
| exit 1 | |
| fi | |
| echo "OK: $url" | |
| done | |
| kill $SERVER_PID 2>/dev/null || true |