Skip to content

Commit

Permalink
Running Jupyter as part of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Jan 30, 2025
1 parent 1b253fc commit c5096cc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,22 @@ jobs:
scripts/run_in_python_env.sh out/venv 'src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
scripts/run_in_python_env.sh out/venv 'scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app'
- name: Execute Jupyter Notebooks
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --jupyter-lab --install_virtual_env out/venv'
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-clang-test \
build \
--copy-artifacts-to objdir-clone \
"
scripts/run_in_python_env.sh out/venv \
"jupyter execute docs/development_controllers/chip-repl/Matter_REPL_Intro.ipynb \
docs/development_controllers/chip-repl/Matter_Basic_Interactions.ipynb \
docs/development_controllers/chip-repl/Matter_Access_Control.ipynb \
docs/development_controllers/chip-repl/Matter_Multi_Fabric_Commissioning.ipynb \
"
- name: Uploading core files
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,14 @@
"os.system('pkill -f chip-all-clusters-app')\n",
"time.sleep(1)\n",
"\n",
"# The location of the all-clusters-app in the cloud playground is one level higher - adjust for this by testing for file presence.\n",
"if (os.path.isfile('../../../out/linux-x64-all-clusters/chip-all-clusters-app')):\n",
" appPath = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"CI_APP_PATH = '../../../out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-clang-test/chip-all-clusters-app'\n",
"LOCAL_APP_PATH = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"\n",
"# Check if the app built by GitHub Actions is present. Otherwise use the standard all-clusters-app \n",
"if (os.path.isfile(CI_APP_PATH)):\n",
" appPath = CI_APP_PATH\n",
"else:\n",
" appPath = '../../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
" appPath = LOCAL_APP_PATH\n",
"\n",
"process = subprocess.Popen(appPath, stdout=subprocess.DEVNULL)\n",
"time.sleep(1)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,16 +644,18 @@
"source": [
"import time, os\n",
"import subprocess\n",
"\n",
"# So that the all-clusters-app won't boot with stale prior state. \n",
"os.system('pkill -f chip-all-clusters-app')\n",
"time.sleep(1)\n",
"\n",
"CI_APP_PATH = '../../../out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-clang-test/chip-all-clusters-app'\n",
"LOCAL_APP_PATH = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"\n",
"# The location of the all-clusters-app in the cloud playground is one level higher - adjust for this by testing for file presence.\n",
"if (os.path.isfile('../../../out/linux-x64-all-clusters/chip-all-clusters-app')):\n",
" appPath = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"# Check if the app built by GitHub Actions is present. Otherwise use the standard all-clusters-app \n",
"if (os.path.isfile(CI_APP_PATH)):\n",
" appPath = CI_APP_PATH\n",
"else:\n",
" appPath = '../../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
" \n",
" appPath = LOCAL_APP_PATH\n",
"\n",
"process = subprocess.Popen(appPath, stdout=subprocess.DEVNULL)\n",
"time.sleep(1)"
]
Expand Down Expand Up @@ -868,7 +870,7 @@
"source": [
"#### Commission Target (BLE + WiFi)\n",
"\n",
"To commission a Wifi-based target over BLE, ensure your BLE stack is up on your host and available as `hci0` on Linux. You can confirm this by running `hciconfig -a`. You'll also need Wifi credentials to join the Thread network.\n",
"To commission a Wifi-based target over BLE, ensure your BLE stack is up on your host and available as `hci0` on Linux. You can confirm this by running `hciconfig -a`. You'll also need Wifi credentials to join the WiFi network.\n",
"\n",
"> NOTE: MacOS Monterey is currently not supported due to issues with its BLE stack."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"%reset -f\n",
"import importlib.util\n",
"spec = importlib.util.find_spec('chip.ChipReplStartup')\n",
"%run {spec.origin}"
"%run {spec.origin} --debug"
]
},
{
Expand Down Expand Up @@ -428,11 +428,14 @@
"os.system('pkill -f chip-all-clusters-app')\n",
"time.sleep(1)\n",
"\n",
"# The location of the all-clusters-app in the cloud playground is one level higher - adjust for this by testing for file presence.\n",
"if (os.path.isfile('../../../out/linux-x64-all-clusters/chip-all-clusters-app')):\n",
" appPath = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"CI_APP_PATH = '../../../out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-clang-test/chip-all-clusters-app'\n",
"LOCAL_APP_PATH = '../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
"\n",
"# Check if the app built by GitHub Actions is present. Otherwise use the standard all-clusters-app \n",
"if (os.path.isfile(CI_APP_PATH)):\n",
" appPath = CI_APP_PATH\n",
"else:\n",
" appPath = '../../../../out/linux-x64-all-clusters/chip-all-clusters-app'\n",
" appPath = LOCAL_APP_PATH\n",
"\n",
"process = subprocess.Popen(appPath, stdout=subprocess.DEVNULL)\n",
"time.sleep(1)"
Expand Down

0 comments on commit c5096cc

Please sign in to comment.