Skip to content

feat(RPS-976): added integration test CI #59

feat(RPS-976): added integration test CI

feat(RPS-976): added integration test CI #59

name: Integration Test
on:
pull_request:
branches:
- main
jobs:
integration-test:
runs-on: ubuntu-latest
env:
API_VERSION: "v1"
API_URL: ""
strategy:
fail-fast: false
max-parallel: 1
matrix:
example_file:
- "01_basic.py"
- "02_plan_and_execute.py"
- "03_move_and_set_ios.py"
- "04_move_multiple_robots.py"
- "05_selection_motion_group_activation.py"
- "06_api_usage.py"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Create NOVA instance and check connection
env:
PORTAL_STG_REFRESH_URL: ${{ secrets.PORTAL_STG_REFRESH_URL }}
PORTAL_STG_REFRESH_CLIENT_ID: ${{ secrets.PORTAL_STG_REFRESH_CLIENT_ID }}
PORTAL_STG_REFRESH_TOKEN: ${{ secrets.PORTAL_STG_REFRESH_TOKEN }}
API_VERSION: "v1"
# Optional
PROJECT_VERSION: "1.0.0"
GITHUB_RUN_ID: ${{ github.run_id }}
INSECURE_CURL: "true" # If you need to skip SSL verification
run: |
source ./scripts/create_nova_instance.sh
echo $PORTAL_STG_HOST
echo "PORTAL_STG_HOST=$PORTAL_STG_HOST" >> $GITHUB_ENV
echo "PORTAL_STG_INSTANCE_ID=$PORTAL_STG_INSTANCE_ID" >> $GITHUB_ENV
echo "PORTAL_STG_ACCESS_TOKEN=$PORTAL_STG_ACCESS_TOKEN" >> $GITHUB_ENV
- name: Set up Python environment
run: |
pip install poetry
poetry install
- name: "Run example: ${{ matrix.example_file }}"
run: |
touch ./.env
echo "NOVA_API=https://${{ env.PORTAL_STG_HOST }}" >> ./.env
echo "NOVA_ACCESS_TOKEN=${{ env.PORTAL_STG_ACCESS_TOKEN }}" >> ./.env
echo "CELL_NAME=cell" >> ./.env
PYTHONPATH=. poetry run python examples/${{ matrix.example_file }}
# Always run cleanup, whether success or failure
- name: Cleanup - Delete instance
if: always()
run: |
./scripts/delete_nova_instance.sh
env:
PORTAL_STG_INSTANCE_ID: ${{ env.PORTAL_STG_INSTANCE_ID }}
PORTAL_STG_ACCESS_TOKEN: ${{ env.PORTAL_STG_ACCESS_TOKEN }}