Skip to content

Commit

Permalink
WIP: Fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakkra committed Sep 23, 2023
1 parent 47759da commit bf1007b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 38 deletions.
59 changes: 25 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
name: Build firmware
on: push
name: Build

env:
ZEPHYR_VERSION: 3.4.0
on:
push:
#pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
NRF:
runs-on: ubuntu-20.04
build:
runs-on: ubuntu-22.04
container: ghcr.io/zephyrproject-rtos/ci:v0.26.2
strategy:
matrix:
ncs_version: [2.4]
board: [zswatch_nrf5340_cpuapp@1,zswatch_nrf5340_cpuapp@2]
built_type: [debug, release]
board: [zswatch_nrf5340_cpuapp@1, zswatch_nrf5340_cpuapp@3, native_posix]
env:
CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
path: project
path: ZSWatch
submodules: recursive
- name: Build ZSWatch Binaries
working-directory: project

- name: Initialize
working-directory: ZSWatch
run: |
docker run -v $PWD:/workdir/project nordicplayground/nrfconnect-sdk:v${{ matrix.ncs_version }}-branch \
west build --board ${{ matrix.board }} /workdir/project/app
west init -l app
west update -o=--depth=1 -n
Posix:
name: Posix build
runs-on: ubuntu-20.04
container:
image: ghcr.io/bcdevices/zephyr:v3.4.0-0
options: --user root
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install deps
run: |
dpkg --add-architecture i386
apt-get -y update
apt-get install --no-install-recommends -y libsdl2-dev:i386
- name: build
run: |
cd /usr/src/zephyr-3.4.0
west build --board native_posix $GITHUB_WORKSPACE/app
- name: Build firmware
working-directory: ZSWatch
run: |
west build app -p -b ${{ matrix.board }} -- -DOVERLAY_CONFIG=boards/${{ matrix.built_type }}.conf
2 changes: 1 addition & 1 deletion app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void run_wdt_work(struct k_work *item)

int main(void)
{
#ifdef CONFIG_TASK_WDT
#if defined(CONFIG_TASK_WDT) && !defined(CONFIG_BOARD_NATIVE_POSIX)
const struct device *hw_wdt_dev = DEVICE_DT_GET(DT_ALIAS(watchdog0));
if (!device_is_ready(hw_wdt_dev)) {
printk("Hardware watchdog %s is not ready; ignoring it.\n",
Expand Down
6 changes: 3 additions & 3 deletions app/src/zsw_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static void single_sector_test(const struct device *flash_dev)

static int zsw_flash_test(void)
{
const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(spi_flash0));
const struct device *flash_dev = DEVICE_DT_GET_OR_NULL(DT_ALIAS(spi_flash0));

if (!device_is_ready(flash_dev)) {
LOG_ERR("No external flash present: %s", flash_dev->name);
if (!flash_dev || !device_is_ready(flash_dev)) {
LOG_ERR("No external flash present: %s", flash_dev ? flash_dev->name: "spi_flash0");
return 0;
}

Expand Down

0 comments on commit bf1007b

Please sign in to comment.