You've already forked beagleconnect-freedom
mirror of
https://github.com/beagleboard/beagleconnect-freedom.git
synced 2026-07-05 01:50:07 +00:00
137 lines
4.5 KiB
YAML
137 lines
4.5 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: firmware
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
# events but only for the master branch
|
|
on:
|
|
[push, pull_request, workflow_dispatch]
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
# This workflow contains a single job called "build"
|
|
build:
|
|
# The type of runner that the job will run on
|
|
runs-on: ubuntu-latest
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Prepare cache timestamp
|
|
id: cache-timestamp
|
|
shell: cmake -P {0}
|
|
run: |
|
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
|
message("::set-output name=timestamp::${current_date}")
|
|
|
|
- name: Install msp430 tools
|
|
run: |
|
|
wget "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-full-linux-x64-installer-9.2.0.0.run"
|
|
chmod +x ./msp430-gcc-full-linux-x64-installer-9.2.0.0.run
|
|
sudo ./msp430-gcc-full-linux-x64-installer-9.2.0.0.run --mode unattended --prefix /opt/msp430-gcc
|
|
rm -f ./msp430-gcc-full-linux-x64-installer-9.2.0.0.run
|
|
/opt/msp430-gcc/bin/msp430-elf-gcc --version
|
|
|
|
- name: Install zephyr prerequisites
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt install -y --no-install-recommends git cmake ninja-build gperf \
|
|
ccache dfu-util device-tree-compiler wget \
|
|
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
|
|
make gcc gcc-multilib g++-multilib libsdl2-dev \
|
|
cmake
|
|
pip3 install --user -U west
|
|
|
|
- name: Cache for ccache
|
|
id: cache-zephyr-ccache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.ccache
|
|
key: zephyr-ccache-2-${{ steps.cache-timestamp.outputs.timestamp }}
|
|
restore-keys: |
|
|
zephyr-ccache-2-2020-
|
|
zephyr-ccache-2-
|
|
|
|
- name: Cache for Zephyr SDK
|
|
id: cache-zephyr-sdk-0_13_1
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/zephyr-sdk
|
|
key: zephyr-sdk-0_13_1
|
|
restore-keys: |
|
|
zephyr-sdk-0_13_1
|
|
|
|
- name: Install Zephyr toolchain
|
|
if: steps.cache-zephyr-sdk-0_13_1.outputs.cache-hit != 'true'
|
|
run: |
|
|
wget "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.13.1/zephyr-sdk-0.13.1-linux-x86_64-setup.run"
|
|
chmod +x zephyr-sdk-0.13.1-linux-x86_64-setup.run
|
|
./zephyr-sdk-0.13.1-linux-x86_64-setup.run -- -d ~/zephyr-sdk
|
|
|
|
- name: Cache for pip
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Prep Zephyr repo
|
|
env:
|
|
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
|
MSP430_TOOLCHAIN_PATH: /opt/msp430-gcc
|
|
ZEPHYR_SDK_INSTALL_DIR: ~/zephyr-sdk
|
|
USE_CCACHE: 0
|
|
run: |
|
|
export PATH=~/.local/bin:"$PATH"
|
|
cd sw/zephyrproject/zephyr
|
|
west update
|
|
west zephyr-export
|
|
pip3 install --user -r scripts/requirements.txt
|
|
|
|
- name: Build firmware
|
|
env:
|
|
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
|
|
MSP430_TOOLCHAIN_PATH: /opt/msp430-gcc
|
|
ZEPHYR_SDK_INSTALL_DIR: ~/zephyr-sdk
|
|
USE_CCACHE: 0
|
|
run: |
|
|
export PATH=~/.local/bin:"$PATH"
|
|
cd sw
|
|
./build-firmware.sh
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: bcf-firmware-bin
|
|
path: |
|
|
sw/build/*
|
|
|
|
- name: Get tag
|
|
id: tag
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: |
|
|
echo "::set-output name=TAG::${GITHUB_REF#refs/tags/}"
|
|
|
|
- name: Prepare release
|
|
id: prepare
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
TAG: ${{ steps.tag.outputs.TAG }}
|
|
run: |
|
|
cd sw/
|
|
zip -r bcf-${{ env.TAG }}.zip build
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
TAG: ${{ steps.tag.outputs.TAG }}
|
|
with:
|
|
files: |
|
|
sw/bcf-${{ env.TAG }}.zip
|