RSDK-8557: test module generator output #30
Workflow file for this run
This file contains 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: Test Template Generators | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
- "module-generation-cli" | |
jobs: | |
generate_and_run_module: | |
# if: github.repository_owner == 'viamrobotics' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
resource: ["arm component"] | |
steps: | |
- name: Setup Go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.23" | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Run module generator | |
run: go run ./cli/viam --debug module generate --resource "${{ matrix.resource }}" | |
- name: Run module | |
run: | | |
cd my-module | |
chmod +x run.sh | |
./run.sh /tmp/viam.sock & | |
PID=$! | |
sleep 5 | |
if ps -p $PID > /dev/null; then | |
echo "Module is running." | |
kill -SIGTERM $PID | |
else | |
echo "Module failed to start." | |
exit 1 | |
fi |