|
| 1 | +name: BabbleSim Networking Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - ".github/workflows/bsim-tests-networking.yaml" |
| 7 | + - ".github/workflows/bsim-tests-publish.yaml" |
| 8 | + - "west.yml" |
| 9 | + - "tests/bsim/net/**" |
| 10 | + - "samples/net/sockets/echo_*/**" |
| 11 | + - "modules/openthread/**" |
| 12 | + - "subsys/net/l2/openthread/**" |
| 13 | + - "include/zephyr/net/openthread.h" |
| 14 | + - "boards/posix/**" |
| 15 | + - "soc/posix/**" |
| 16 | + - "arch/posix/**" |
| 17 | + - "drivers/ieee802154/**" |
| 18 | + - "include/zephyr/net/ieee802154*" |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +jobs: |
| 25 | + bsim-test-networking: |
| 26 | + if: github.repository_owner == 'zephyrproject-rtos' |
| 27 | + runs-on: zephyr-runner-linux-x64-4xlarge |
| 28 | + container: |
| 29 | + image: ghcr.io/zephyrproject-rtos/ci:v0.25.1 |
| 30 | + options: '--entrypoint /bin/bash' |
| 31 | + volumes: |
| 32 | + - /repo-cache/zephyrproject:/github/cache/zephyrproject |
| 33 | + env: |
| 34 | + ZEPHYR_TOOLCHAIN_VARIANT: zephyr |
| 35 | + ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.0 |
| 36 | + BSIM_OUT_PATH: /opt/bsim/ |
| 37 | + BSIM_COMPONENTS_PATH: /opt/bsim/components |
| 38 | + EDTT_PATH: ../tools/edtt |
| 39 | + bsim_test_results_file: ./bsim_out/bsim_results.xml |
| 40 | + steps: |
| 41 | + - name: Apply container owner mismatch workaround |
| 42 | + run: | |
| 43 | + # FIXME: The owner UID of the GITHUB_WORKSPACE directory may not |
| 44 | + # match the container user UID because of the way GitHub |
| 45 | + # Actions runner is implemented. Remove this workaround when |
| 46 | + # GitHub comes up with a fundamental fix for this problem. |
| 47 | + git config --global --add safe.directory ${GITHUB_WORKSPACE} |
| 48 | +
|
| 49 | + - name: Clone cached Zephyr repository |
| 50 | + continue-on-error: true |
| 51 | + run: | |
| 52 | + git clone --shared /github/cache/zephyrproject/zephyr . |
| 53 | + git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} |
| 54 | +
|
| 55 | + - name: Checkout |
| 56 | + uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + fetch-depth: 0 |
| 59 | + |
| 60 | + - name: Environment Setup |
| 61 | + env: |
| 62 | + BASE_REF: ${{ github.base_ref }} |
| 63 | + run: | |
| 64 | + git config --global user.email "bot@zephyrproject.org" |
| 65 | + git config --global user.name "Zephyr Bot" |
| 66 | + rm -fr ".git/rebase-apply" |
| 67 | + git rebase origin/${BASE_REF} |
| 68 | + git log --pretty=oneline | head -n 10 |
| 69 | + west init -l . || true |
| 70 | + west config manifest.group-filter -- +ci |
| 71 | + west config --global update.narrow true |
| 72 | + west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject) |
| 73 | + west forall -c 'git reset --hard HEAD' |
| 74 | +
|
| 75 | + - name: Run Networking Tests with BSIM |
| 76 | + run: | |
| 77 | + export ZEPHYR_BASE=${PWD} |
| 78 | + WORK_DIR=${ZEPHYR_BASE}/bsim_out tests/bsim/net/compile.sh |
| 79 | + RESULTS_FILE=${ZEPHYR_BASE}/${bsim_test_results_file} \ |
| 80 | + SEARCH_PATH=tests/bsim/net/ tests/bsim/run_parallel.sh |
| 81 | +
|
| 82 | + - name: Upload Test Results |
| 83 | + if: always() |
| 84 | + uses: actions/upload-artifact@v3 |
| 85 | + with: |
| 86 | + name: bsim-test-results |
| 87 | + path: | |
| 88 | + ./bsim_out/bsim_results.xml |
| 89 | + ${{ github.event_path }} |
| 90 | +
|
| 91 | + - name: Upload Event Details |
| 92 | + if: always() |
| 93 | + uses: actions/upload-artifact@v3 |
| 94 | + with: |
| 95 | + name: event |
| 96 | + path: | |
| 97 | + ${{ github.event_path }} |
0 commit comments