|
| 1 | +# |
| 2 | +# Copyright (c) 2020, The OpenThread Authors. |
| 3 | +# All rights reserved. |
| 4 | +# |
| 5 | +# Redistribution and use in source and binary forms, with or without |
| 6 | +# modification, are permitted provided that the following conditions are met: |
| 7 | +# 1. Redistributions of source code must retain the above copyright |
| 8 | +# notice, this list of conditions and the following disclaimer. |
| 9 | +# 2. Redistributions in binary form must reproduce the above copyright |
| 10 | +# notice, this list of conditions and the following disclaimer in the |
| 11 | +# documentation and/or other materials provided with the distribution. |
| 12 | +# 3. Neither the name of the copyright holder nor the |
| 13 | +# names of its contributors may be used to endorse or promote products |
| 14 | +# derived from this software without specific prior written permission. |
| 15 | +# |
| 16 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 | +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 20 | +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 23 | +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 24 | +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 25 | +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 26 | +# POSSIBILITY OF SUCH DAMAGE. |
| 27 | +# |
| 28 | + |
| 29 | +name: Build |
| 30 | + |
| 31 | +on: |
| 32 | + push: |
| 33 | + branches-ignore: |
| 34 | + - 'dependabot/**' |
| 35 | + pull_request: |
| 36 | + branches: |
| 37 | + - 'main' |
| 38 | + |
| 39 | +jobs: |
| 40 | + |
| 41 | + cancel-previous-runs: |
| 42 | + runs-on: ubuntu-20.04 |
| 43 | + steps: |
| 44 | + - uses: rokroskar/workflow-run-cleanup-action@master |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 47 | + if: "github.ref != 'refs/heads/main'" |
| 48 | + |
| 49 | + pretty: |
| 50 | + runs-on: ubuntu-20.04 |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + with: |
| 54 | + submodules: true |
| 55 | + - name: Bootstrap |
| 56 | + run: | |
| 57 | + sudo rm /etc/apt/sources.list.d/* && sudo apt-get update |
| 58 | + sudo apt-get --no-install-recommends install -y clang-format-9 shellcheck |
| 59 | + python3 -m pip install yapf==0.29.0 |
| 60 | + sudo snap install shfmt |
| 61 | + - name: Check |
| 62 | + run: | |
| 63 | + script/make-pretty check |
| 64 | + arm-gcc: |
| 65 | + name: arm-gcc-${{ matrix.gcc_ver }} |
| 66 | + runs-on: ubuntu-18.04 |
| 67 | + strategy: |
| 68 | + matrix: |
| 69 | + include: |
| 70 | + - gcc_ver: 4 |
| 71 | + gcc_download_url: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 |
| 72 | + gcc_extract_dir: gcc-arm-none-eabi-4_9-2015q3 |
| 73 | + - gcc_ver: 5 |
| 74 | + gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/5_4-2016q3/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 |
| 75 | + gcc_extract_dir: gcc-arm-none-eabi-5_4-2016q3 |
| 76 | + - gcc_ver: 6 |
| 77 | + gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 |
| 78 | + gcc_extract_dir: gcc-arm-none-eabi-6-2017-q2-update |
| 79 | + - gcc_ver: 7 |
| 80 | + gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 |
| 81 | + gcc_extract_dir: gcc-arm-none-eabi-7-2018-q2-update |
| 82 | + - gcc_ver: 9 |
| 83 | + gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 |
| 84 | + gcc_extract_dir: gcc-arm-none-eabi-9-2019-q4-major |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v2 |
| 87 | + with: |
| 88 | + submodules: true |
| 89 | + - name: Bootstrap |
| 90 | + run: | |
| 91 | + cd /tmp |
| 92 | + sudo rm /etc/apt/sources.list.d/* && sudo apt-get update |
| 93 | + sudo apt-get --no-install-recommends install -y lib32z1 ninja-build python3-setuptools |
| 94 | + wget ${{ matrix.gcc_download_url }} -O gcc-arm.tar.bz2 |
| 95 | + tar xjf gcc-arm.tar.bz2 |
| 96 | + # use the minimal required cmake version |
| 97 | + sudo pip3 install --system -U cmake==3.10.3 |
| 98 | + sudo pip3 install pycrypto |
| 99 | + sudo pip3 install pycryptodome |
| 100 | + cmake --version | grep 3.10.3 |
| 101 | + mkdir -p sdk_k32w061 |
| 102 | + cd sdk_k32w061 |
| 103 | + wget https://mcuxpresso.nxp.com/eclipse/sdk/2.6.3/plugins/com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar |
| 104 | + unzip com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar |
| 105 | + rm -rf com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar |
| 106 | + cd sdks |
| 107 | + unzip 5faab205f2663647c5c7ce05c382d2a8.zip |
| 108 | + rm -rf 5faab205f2663647c5c7ce05c382d2a8.zip |
| 109 | + cd /tmp |
| 110 | + mkdir -p sdk_jn5189 |
| 111 | + cd sdk_jn5189 |
| 112 | + wget https://mcuxpresso.nxp.com/eclipse/sdk/2.6.3/plugins/com.nxp.mcuxpresso.sdk.sdk_2.x_jn5189dk6_2.6.3.201911251446.jar |
| 113 | + unzip com.nxp.mcuxpresso.sdk.sdk_2.x_jn5189dk6_2.6.3.201911251446.jar |
| 114 | + rm -rf com.nxp.mcuxpresso.sdk.sdk_2.x_jn5189dk6_2.6.3.201911251446.jar |
| 115 | + cd sdks |
| 116 | + unzip 3527851720d25fc0a442c508518c1214.zip |
| 117 | + rm -rf 3527851720d25fc0a442c508518c1214.zip |
| 118 | + |
| 119 | + - name: Build |
| 120 | + run: | |
| 121 | + export PATH=/tmp/${{ matrix.gcc_extract_dir }}/bin:$PATH |
| 122 | + export NXP_K32W061_SDK_ROOT=/tmp/sdk_k32w061/sdks/ |
| 123 | + export NXP_JN5189_SDK_ROOT=/tmp/sdk_jn5189/sdks/ |
| 124 | + chmod +x $NXP_K32W061_SDK_ROOT/tools/imagetool/sign_images.sh |
| 125 | + chmod +x $NXP_JN5189_SDK_ROOT/tools/imagetool/sign_images.sh |
| 126 | + third_party/k32w061_sdk/mr3_fixes/patch_k32w061_mr3_sdk.sh |
| 127 | + third_party/jn5189_sdk/mr3_fixes/patch_jn5189_mr3_sdk.sh |
| 128 | + script/test |
0 commit comments