|
| 1 | +name: MSPM33 Zephyr Build Automation Workflow |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - dev_mspm33 |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - dev_mspm33 |
| 10 | + |
| 11 | +jobs: |
| 12 | + mspm33_build_all: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Set up environment |
| 17 | + run: | |
| 18 | + sudo apt install --no-install-recommends git cmake ninja-build gperf \ |
| 19 | + ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \ |
| 20 | + xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 |
| 21 | +
|
| 22 | + - name: Check versions |
| 23 | + run: | |
| 24 | + cmake --version |
| 25 | + python3 --version |
| 26 | + dtc --version |
| 27 | +
|
| 28 | + - name: Create virtual environment |
| 29 | + run: | |
| 30 | + python3 -m venv ~/zephyrproject/.venv |
| 31 | +
|
| 32 | + - name: Activate virtual environment and install west |
| 33 | + run: | |
| 34 | + source ~/zephyrproject/.venv/bin/activate |
| 35 | + pip install --upgrade pip |
| 36 | + pip install west |
| 37 | +
|
| 38 | + - name: Get the Zephyr source code |
| 39 | + run: | |
| 40 | + source ~/zephyrproject/.venv/bin/activate |
| 41 | + west init -m https://github.com/TexasInstruments/msp-zephyr --mr dev_mspm33 ~/zephyrproject |
| 42 | + cd ~/zephyrproject |
| 43 | + west update |
| 44 | +
|
| 45 | + - name: Export a Zephyr CMake package |
| 46 | + run: | |
| 47 | + source ~/zephyrproject/.venv/bin/activate |
| 48 | + cd ~/zephyrproject |
| 49 | + west zephyr-export |
| 50 | + |
| 51 | + - name: Install Zephyr dependencies |
| 52 | + run: | |
| 53 | + source ~/zephyrproject/.venv/bin/activate |
| 54 | + cd ~/zephyrproject |
| 55 | + ~/zephyrproject/.venv/bin/python -m pip install -r ~/zephyrproject/zephyr/scripts/requirements.txt |
| 56 | + west packages pip --install |
| 57 | + |
| 58 | + - name: Install Zephyr SDK |
| 59 | + run: | |
| 60 | + source ~/zephyrproject/.venv/bin/activate |
| 61 | + cd ~/zephyrproject/zephyr |
| 62 | + west sdk install --toolchain=arm-zephyr-eabi |
| 63 | + |
| 64 | + - name: Build Blinky example |
| 65 | + run: | |
| 66 | + source ~/zephyrproject/.venv/bin/activate |
| 67 | + cd ~/zephyrproject/zephyr |
| 68 | + source ~/zephyrproject/zephyr/zephyr-env.sh |
| 69 | + west build -p always -b lp_mspm33c321a samples/basic/blinky |
| 70 | + mkdir -p ~/artifacts/blinky |
| 71 | + cp build/zephyr/zephyr.elf ~/artifacts/blinky/ |
| 72 | + cp build/zephyr/zephyr.bin ~/artifacts/blinky/ || true |
| 73 | + cp build/zephyr/zephyr.hex ~/artifacts/blinky/ || true |
| 74 | + |
| 75 | + - name: Build ADC Sequence example |
| 76 | + run: | |
| 77 | + source ~/zephyrproject/.venv/bin/activate |
| 78 | + cd ~/zephyrproject/zephyr |
| 79 | + source ~/zephyrproject/zephyr/zephyr-env.sh |
| 80 | + west build -p always -b lp_mspm33c321a samples/drivers/adc/adc_sequence |
| 81 | + mkdir -p ~/artifacts/adc_sequence |
| 82 | + cp build/zephyr/zephyr.elf ~/artifacts/adc_sequence/ |
| 83 | + cp build/zephyr/zephyr.bin ~/artifacts/adc_sequence/ || true |
| 84 | + cp build/zephyr/zephyr.hex ~/artifacts/adc_sequence/ || true |
| 85 | + |
| 86 | + - name: Build Counter Alarm example |
| 87 | + run: | |
| 88 | + source ~/zephyrproject/.venv/bin/activate |
| 89 | + cd ~/zephyrproject/zephyr |
| 90 | + source ~/zephyrproject/zephyr/zephyr-env.sh |
| 91 | + west build -p always -b lp_mspm33c321a samples/drivers/counter/alarm |
| 92 | + mkdir -p ~/artifacts/counter_alarm |
| 93 | + cp build/zephyr/zephyr.elf ~/artifacts/counter_alarm/ |
| 94 | + cp build/zephyr/zephyr.bin ~/artifacts/counter_alarm/ || true |
| 95 | + cp build/zephyr/zephyr.hex ~/artifacts/counter_alarm/ || true |
| 96 | +
|
0 commit comments