zephyr.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: Zephyr tests
  2. # START OF COMMON SECTION
  3. on:
  4. push:
  5. branches: [ 'master', 'main', 'release/**' ]
  6. pull_request:
  7. branches: [ '*' ]
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.ref }}
  10. cancel-in-progress: true
  11. # END OF COMMON SECTION
  12. jobs:
  13. run_test:
  14. name: Build and run
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. config:
  19. - zephyr-ref: v3.4.0
  20. zephyr-sdk: 0.16.1
  21. - zephyr-ref: v3.5.0
  22. zephyr-sdk: 0.16.3
  23. - zephyr-ref: v2.7.4
  24. zephyr-sdk: 0.16.3
  25. runs-on: ubuntu-latest
  26. # This should be a safe limit for the tests to run.
  27. timeout-minutes: 25
  28. steps:
  29. - name: Install dependencies
  30. run: |
  31. # Don't prompt for anything
  32. export DEBIAN_FRONTEND=noninteractive
  33. sudo apt-get update
  34. # most of the ci-base zephyr docker image packages
  35. sudo apt-get install -y zip bridge-utils uml-utilities \
  36. git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \
  37. python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
  38. make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
  39. autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \
  40. cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \
  41. gcovr git git-core gnupg gperf gtk-sharp2 help2man iproute2 lcov libcairo2-dev \
  42. libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \
  43. libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \
  44. net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \
  45. python3-ply python3-setuptools python-is-python3 qemu rsync socat srecord sudo \
  46. texinfo unzip wget ovmf xz-utils
  47. - name: Install west
  48. run: sudo pip install west
  49. - name: Init west workspace
  50. run: west init --mr ${{ matrix.config.zephyr-ref }} zephyr
  51. - name: Update west.yml
  52. working-directory: zephyr/zephyr
  53. run: |
  54. REF=$(echo '${{ github.ref }}' | sed -e 's/\//\\\//g')
  55. sed -e 's/remotes:/remotes:\n \- name: wolfssl\n url\-base: https:\/\/github.com\/${{ github.repository_owner }}/' -i west.yml
  56. sed -e "s/projects:/projects:\n \- name: wolfssl\n path: modules\/crypto\/wolfssl\n remote: wolfssl\n revision: $REF/" -i west.yml
  57. - name: Update west workspace
  58. working-directory: zephyr
  59. run: west update -n -o=--depth=1
  60. - name: Export zephyr
  61. working-directory: zephyr
  62. run: west zephyr-export
  63. - name: Install pip dependencies
  64. working-directory: zephyr
  65. run: sudo pip install -r zephyr/scripts/requirements.txt
  66. - name: Install zephyr SDK
  67. run: |
  68. wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ matrix.config.zephyr-sdk }}/zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
  69. tar xf zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
  70. cd zephyr-sdk-${{ matrix.config.zephyr-sdk }}
  71. ./setup.sh -h -c -t x86_64-zephyr-elf
  72. - name: Fix options for 2.7.4
  73. if: ${{ matrix.config.zephyr-ref == 'v2.7.4' }}
  74. working-directory: zephyr/modules/crypto/wolfssl
  75. run: |
  76. sed -i -e 's/CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE/CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE/g' $(find -name prj.conf)
  77. - name: Run wolfssl test
  78. id: wolfssl-test
  79. working-directory: zephyr
  80. run: |
  81. ./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test -vvv
  82. rm -rf zephyr/twister-out
  83. ./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test_no_malloc -vvv
  84. rm -rf zephyr/twister-out
  85. - name: Run wolfssl TLS sock test
  86. # Results in a page fault that I can't trace
  87. if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
  88. id: wolfssl-tls-sock
  89. working-directory: zephyr
  90. run: |
  91. ./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock -vvv
  92. rm -rf zephyr/twister-out
  93. ./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock_no_malloc -vvv
  94. rm -rf zephyr/twister-out
  95. - name: Run wolfssl TLS thread test
  96. if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
  97. id: wolfssl-tls-thread
  98. working-directory: zephyr
  99. run: |
  100. ./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_thread/sample.crypto.wolfssl_tls_thread -vvv
  101. rm -rf zephyr/twister-out
  102. - name: Zip failure logs
  103. if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }}
  104. run: |
  105. zip -9 -r logs.zip zephyr/twister-out
  106. - name: Upload failure logs
  107. if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }}
  108. uses: actions/upload-artifact@v4
  109. with:
  110. name: zephyr-client-test-logs
  111. path: logs.zip
  112. retention-days: 5