From f7c6692a825c0781b4d5ee7494da087fb60cef89 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 19 Jun 2021 16:42:38 +0200 Subject: [PATCH] setup CI skeleton --- .build.yml | 91 ++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 16 ++++++++ case/Makefile | 2 + firmware/Makefile | 26 +++++++++++++ firmware/fiatlux.c | 16 ++++++++ pcb/Makefile | 4 ++ 6 files changed, 155 insertions(+) create mode 100644 .build.yml create mode 100644 Makefile create mode 100644 case/Makefile create mode 100644 firmware/Makefile create mode 100644 firmware/fiatlux.c create mode 100644 pcb/Makefile diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..df72ca3 --- /dev/null +++ b/.build.yml @@ -0,0 +1,91 @@ +kind: pipeline +type: docker +name: default + +image: +tasks: + - +steps: +- name: submodules + image: alpine/git + commands: + - git submodule update --init --recursive + +- name: patch + image: alpine/git + depends_on: [ submodules ] + commands: + - |- + sed -i 's/GNU bash, version (3\\\.\[1-9\]|4)/GNU bash, version (3.[1-9]|4|5)/g' modules/sdk/crosstool-NG/configure.ac + + - mkdir -p modules/sdk/crosstool-NG/.build/tarballs + - wget https://github.com/libexpat/libexpat/releases/download/R_2_1_0/expat-2.1.0.tar.gz -O modules/sdk/crosstool-NG/.build/tarballs/expat-2.1.0.tar.gz + +- name: toolchain + image: debian:sid + depends_on: [ patch ] + commands: + - apt update + - apt install -y make bash gawk g++ gcc libc6-dev flex bison automake autoconf gperf texinfo wget git bzip2 help2man libtool libtool-bin unrar-free unzip ncurses-dev libexpat-dev python-dev python3 + - cd modules/sdk + - export CT_EXPERIMENTAL=y + - export CT_ALLOW_BUILD_AS_ROOT=y + - export CT_ALLOW_BUILD_AS_ROOT_SURE=y + - make standalone=y -j$(nproc) + - wget -N https://raw.githubusercontent.com/espressif/esptool/master/esptool.py -O xtensa-lx106-elf/bin/esptool.py + +- name: firmware + image: debian:sid + depends_on: [ toolchain ] + commands: + - apt update + - apt remove --purge -y python2 + - apt install -y make python3 python3-serial python-is-python3 perl + - export PATH=$(pwd)/modules/sdk/xtensa-lx106-elf/bin:$PATH + - make firmware -j$(nproc) + +- name: pcb + image: setsoft/kicad_auto + commands: + - apt update + - apt install -y make zip + - make pcb -j$(nproc) + +- name: case + image: debian:sid + commands: + - apt update + - apt install -y make + - make case -j$(nproc) + +- name: unittest + image: debian:sid + depends_on: [ patch ] + commands: + - apt update + - apt install -y make + - make -C firmware unittest + +- name: systest + image: debian:sid + depends_on: [ firmware ] + commands: + - apt update + - apt install -y make + - make -C firmware systest + +- name: gitea_release + image: plugins/gitea-release + depends_on: [ firmware, pcb, case, unittest, systest ] + settings: + api_key: + from_secret: j3d1_droneio_key + base_url: https://git.neulandlabor.de/ + files: + - firmware/firmware/fiatlux.bin + checksum: + - sha512 + - md5 + title: buildtest + when: + event: tag diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7d6ee6a --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ + +.PHONY: firmware case pcb + +all: firmware case pcb + +firmware: + +@make -C firmware all + +flash: + +@make -C firmware flash + +case: + +@make -C case all + +pcb: + +@make -C pcb all diff --git a/case/Makefile b/case/Makefile new file mode 100644 index 0000000..b90d248 --- /dev/null +++ b/case/Makefile @@ -0,0 +1,2 @@ +all: + @echo case diff --git a/firmware/Makefile b/firmware/Makefile new file mode 100644 index 0000000..8006a40 --- /dev/null +++ b/firmware/Makefile @@ -0,0 +1,26 @@ +PROGRAM=fiatlux + +EXTRA_CFLAGS=-O3 + +#Enable debugging +#EXTRA_CFLAGS+=-DLWIP_DEBUG=1 -DHTTPD_DEBUG=LWIP_DBG_ON + +EXTRA_COMPONENTS=extras/i2s_dma extras/ws2812_i2s extras/dhcpserver extras/mbedtls extras/sntp extras/cpp_support + +LIBS = hal m + +FLASH_MODE = dio + +include ../modules/rtos/common.mk + +html: + @echo "Generating fsdata.." + cd fsdata && ./makefsdata + +test: unittest systest + +unittest: + true + +systest: + true diff --git a/firmware/fiatlux.c b/firmware/fiatlux.c new file mode 100644 index 0000000..c804798 --- /dev/null +++ b/firmware/fiatlux.c @@ -0,0 +1,16 @@ +#include +#include +#include + + + + +void user_init(void) +{ + uart_set_baud(0, 115200); + printf("SDK version: %s\n", sdk_system_get_sdk_version()); + + sdk_wifi_set_sleep_type(WIFI_SLEEP_MODEM); + + while(1); +} diff --git a/pcb/Makefile b/pcb/Makefile new file mode 100644 index 0000000..181d4fb --- /dev/null +++ b/pcb/Makefile @@ -0,0 +1,4 @@ +all: + @mkdir -p gen + @touch gen/foo + @cd gen; zip ../gen.zip *