Zephyr: examples: add hello #437
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Firmware Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
lint_and_unit_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
architecture: 'x64' | |
- name: Check code formatting | |
shell: bash | |
run: | | |
git fetch --no-recurse-submodules | |
echo "Checking code format" | |
sudo apt install clang-format | |
REPO_ROOT=`pwd` ./scripts/lint/ci_check_clang_format.sh --merge-base origin/$GITHUB_BASE_REF | |
- name: Run unit tests | |
shell: bash | |
run: | | |
cd test | |
./test.sh | |
linux_build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
architecture: 'x64' | |
- name: Install Linux deps | |
shell: bash | |
run: | | |
sudo apt install libssl-dev | |
- name: Build golioth_basics | |
shell: bash | |
run: | | |
cd examples/linux/golioth_basics | |
echo "#define GOLIOTH_PSK_ID \"device@project\"" > credentials.inc | |
echo "#define GOLIOTH_PSK \"secret\"" >> credentials.inc | |
./build.sh | |
- name: Build certificate_auth | |
shell: bash | |
run: | | |
cd examples/linux/certificate_auth | |
./build.sh | |
esp_idf_build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
architecture: 'x64' | |
- name: Build ESP-IDF golioth_basics project | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v5.0 | |
target: esp32 | |
path: 'examples/esp_idf/golioth_basics' | |
- name: Build ESP-IDF cpp project | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v5.0 | |
target: esp32 | |
path: 'examples/esp_idf/cpp' | |
- name: Create empty certs/keys required by certificate_auth project | |
shell: bash | |
run: | | |
cd examples/esp_idf/certificate_auth | |
mkdir -p main/certs | |
cd main | |
touch certs/client.key | |
touch certs/client.pem | |
touch root_ca.pem | |
- name: Build ESP-IDF certificate_auth project | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v5.0 | |
target: esp32 | |
path: 'examples/esp_idf/certificate_auth' | |
- name: Build ESP-IDF magtag_demo project | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v5.0 | |
target: esp32 | |
path: 'examples/esp_idf/magtag_demo' | |
esp_idf_old_release_build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
architecture: 'x64' | |
- name: Build ESP-IDF golioth_basics project with IDF 4.4.2 | |
uses: espressif/esp-idf-ci-action@v1 | |
with: | |
esp_idf_version: v4.4.2 | |
target: esp32 | |
path: 'examples/esp_idf/golioth_basics' | |
modus_toolbox_build: | |
runs-on: ubuntu-latest | |
env: | |
MTB_VERSION: 2.4.0.5972 | |
MTB_TOOLS_VERSION: 2.4 | |
MTB_DOWNLOAD_ID: 1x_YeXR4XSjaf-NZimKxQ8MIyDGo72yHt | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
architecture: 'x64' | |
- name: Download and install ModusToolbox 2.4 | |
shell: bash | |
run: | | |
pip install click gdown cryptography intelhex cbor | |
gdown $MTB_DOWNLOAD_ID -O /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz | |
tar -C $HOME -zxf /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz | |
rm /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz | |
$HOME/ModusToolbox/tools_$MTB_TOOLS_VERSION/modus-shell/postinstall | |
- name: Build MTB golioth_basics project | |
shell: bash | |
run: | | |
# Ref: https://community.infineon.com/t5/ModusToolbox-General/ModusToolbox-Project-Creator-and-Library-Manager-report-no-Internet-connection/td-p/347593 | |
export CyRemoteManifestOverride=https://github.com/cypresssemiconductorco/mtb-super-manifest/raw/v2.X/mtb-super-manifest-fv2.xml | |
export CY_TOOLS_PATHS=$HOME/ModusToolbox/tools_$MTB_TOOLS_VERSION | |
cd examples/modus_toolbox/golioth_basics/golioth_app | |
cp source/credentials.inc.template source/credentials.inc | |
make getlibs | |
make build -j8 | |
zephyr_build: | |
container: | |
image: zephyrprojectrtos/ci:v0.26.4 | |
env: | |
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.16.1 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
path: modules/lib/golioth-firmware-sdk | |
submodules: 'recursive' | |
- name: Init and update west | |
run: | | |
mkdir -p .west | |
cat <<EOF > .west/config | |
[manifest] | |
path = modules/lib/golioth-firmware-sdk | |
file = west-zephyr.yml | |
EOF | |
west update -o=--depth=1 -n | |
- name: Run twister | |
run: > | |
zephyr/scripts/twister | |
-b | |
-p nrf52840dk_nrf52840 | |
-p qemu_x86 | |
-o reports | |
-T modules/lib/golioth-firmware-sdk | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
if: ${{ always() }} | |
with: | |
name: twister-artifacts | |
path: | | |
reports/* | |
twister-out/**/build.log |