|
| 1 | +name: Zephyr tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + run_test: |
| 8 | + name: Build and run |
| 9 | + runs-on: ubuntu-latest |
| 10 | + timeout-minutes: 20 |
| 11 | + steps: |
| 12 | + - name: Install dependencies |
| 13 | + run: | |
| 14 | + # Don't prompt for anything |
| 15 | + export DEBIAN_FRONTEND=noninteractive |
| 16 | + sudo apt-get update |
| 17 | + # most of the ci-base zephyr docker image packages |
| 18 | + sudo apt-get install -y zip bridge-utils uml-utilities \ |
| 19 | + git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \ |
| 20 | + python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ |
| 21 | + make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \ |
| 22 | + autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \ |
| 23 | + cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \ |
| 24 | + gcovr git git-core gnupg gperf gtk-sharp2 help2man iproute2 lcov libcairo2-dev \ |
| 25 | + libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \ |
| 26 | + libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \ |
| 27 | + net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \ |
| 28 | + python3-ply python3-setuptools python-is-python3 qemu rsync socat srecord sudo \ |
| 29 | + texinfo unzip wget ovmf xz-utils |
| 30 | +
|
| 31 | + - name: Install west |
| 32 | + run: sudo pip install west |
| 33 | + |
| 34 | + - name: Init west workspace |
| 35 | + run: west init zephyr |
| 36 | + |
| 37 | + - name: Update west.yml |
| 38 | + working-directory: zephyr/zephyr |
| 39 | + run: | |
| 40 | + REF=$(echo '${{ github.ref }}' | sed -e 's/\//\\\//g') |
| 41 | + sed -e 's/remotes:/remotes:\n \- name: wolfssl\n url\-base: https:\/\/github.com\/${{ github.repository_owner }}/' -i west.yml |
| 42 | + sed -e "s/projects:/projects:\n \- name: wolfssl\n path: modules\/crypto\/wolfssl\n remote: wolfssl\n revision: $REF/" -i west.yml |
| 43 | +
|
| 44 | + - name: Update west workspace |
| 45 | + working-directory: zephyr |
| 46 | + run: west update -n -o=--depth=1 |
| 47 | + |
| 48 | + - name: Export zephyr |
| 49 | + working-directory: zephyr |
| 50 | + run: west zephyr-export |
| 51 | + |
| 52 | + - name: Install pip dependencies |
| 53 | + working-directory: zephyr |
| 54 | + run: sudo pip install -r zephyr/scripts/requirements.txt |
| 55 | + |
| 56 | + - name: Install zephyr SDK |
| 57 | + run: | |
| 58 | + wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64.tar.xz |
| 59 | + tar xf zephyr-sdk-0.16.1_linux-x86_64.tar.xz |
| 60 | + cd zephyr-sdk-0.16.1 |
| 61 | + ./setup.sh -h -c |
| 62 | +
|
| 63 | + - name: Run wolfssl test |
| 64 | + id: wolfssl-test |
| 65 | + working-directory: zephyr |
| 66 | + run: | |
| 67 | + ./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test -vvv |
| 68 | + rm -rf zephyr/twister-out |
| 69 | +
|
| 70 | + - name: Run wolfssl TLS sock test |
| 71 | + id: wolfssl-tls-sock |
| 72 | + working-directory: zephyr |
| 73 | + run: | |
| 74 | + ./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock -vvv |
| 75 | + rm -rf zephyr/twister-out |
| 76 | +
|
| 77 | + - name: Run wolfssl TLS thread test |
| 78 | + id: wolfssl-tls-thread |
| 79 | + working-directory: zephyr |
| 80 | + run: | |
| 81 | + ./zephyr/scripts/twister --testsuite-root modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_thread/sample.crypto.wolfssl_tls_thread -vvv |
| 82 | + rm -rf zephyr/twister-out |
| 83 | +
|
| 84 | + - name: Zip failure logs |
| 85 | + if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }} |
| 86 | + run: | |
| 87 | + zip -9 -r logs.zip zephyr/twister-out |
| 88 | +
|
| 89 | + - name: Upload failure logs |
| 90 | + if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }} |
| 91 | + uses: actions/upload-artifact@v3 |
| 92 | + with: |
| 93 | + name: zephyr-client-test-logs |
| 94 | + path: logs.zip |
| 95 | + retention-days: 5 |
0 commit comments