1
0

zephyr.yml 5.5 KB

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