-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RPS-976): added integration test CI (#25)
Co-authored-by: cbiering <christoph.biering@wandelbots.com>
- Loading branch information
Showing
15 changed files
with
520 additions
and
219 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Run examples | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-examples: | ||
runs-on: ubuntu-latest | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
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: examples/${{ 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 | ||
n=0 | ||
max_retries=3 | ||
until [ $n -ge $max_retries ] | ||
do | ||
echo "Attempt $((n+1)) to run ${{ matrix.example_file }}..." | ||
PYTHONPATH=. poetry run python examples/${{ matrix.example_file }} && break | ||
n=$((n+1)) | ||
echo "Failed attempt $n. Retrying in 5s..." | ||
sleep 5 | ||
done | ||
if [ $n -ge $max_retries ]; then | ||
echo "Failed after $max_retries attempts." | ||
exit 1 | ||
fi | ||
# 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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
devportal.env | ||
.devcontainer/devcontainer.env | ||
# from Makefile generated | ||
.formatted | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export PORTAL_STG_REFRESH_URL="" | ||
export PORTAL_STG_REFRESH_TOKEN="" | ||
export PORTAL_STG_REFRESH_CLIENT_ID="" | ||
export API_VERSION="v1" |
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
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
Oops, something went wrong.