Add github workflow for ci testing #5
Workflow file for this run
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: Devcontainer cargo test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| jobs: | |
| cargo-test-suite: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build devcontainer image | |
| run: | | |
| docker build \ | |
| --file .devcontainer/Dockerfile \ | |
| --platform linux/amd64 \ | |
| --tag nrf-rpc-dev \ | |
| . | |
| - name: Run cargo test inside container | |
| run: | | |
| docker run --rm \ | |
| -v "$GITHUB_WORKSPACE:/workspace" \ | |
| -w /workspace \ | |
| nrf-rpc-dev \ | |
| bash -lc "git config --global --add safe.directory /workspace && cd tests && ./zephyr_setup.sh && cd /workspace && cargo test --workspace" | |
| cargo-compile-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Cargo check (compile test) | |
| run: cargo check --workspace --all-targets | |