Skip to content

Commit 6c34ff9

Browse files
authored
Merge pull request SiliconLabs#2 from rzr/SiliconLabsGH-9/UIC-3082/phcoval/main
SiliconLabsGH-14: Enable CI
2 parents 306a0b1 + 7db49e7 commit 6c34ff9

File tree

3 files changed

+182
-0
lines changed

3 files changed

+182
-0
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/[email protected]
14+
with:
15+
fetch-depth: 0
16+
- name: Build Docker image from sources
17+
run: docker build .

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/echo docker build . -f
2+
# -*- coding: utf-8 -*-
3+
4+
FROM debian:12
5+
6+
ENV DEBIAN_FRONTEND noninteractive
7+
ENV LC_ALL en_US.UTF-8
8+
ENV LANG ${LC_ALL}
9+
10+
RUN echo "# log: Configuring locales" \
11+
&& set -x \
12+
&& apt-get update -y \
13+
&& apt-get install -y locales \
14+
&& echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \
15+
&& locale-gen ${LC_ALL} \
16+
&& dpkg-reconfigure locales \
17+
&& TZ=Etc/UTC apt-get -y install tzdata \
18+
&& date -u
19+
20+
ENV project UnifySDK
21+
ENV workdir /usr/local/opt/${project}
22+
ADD . ${workdir}
23+
24+
WORKDIR ${workdir}
25+
26+
RUN echo "# log: Setup system" \
27+
&& set -x \
28+
&& apt-get install -y make sudo \
29+
&& ./helper.mk help setup/debian/12 \
30+
&& date -u
31+
32+
RUN echo "# log: Build" \
33+
&& set -x \
34+
&& ./helper.mk \
35+
&& date -u

helper.mk

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/usr/bin/make -f
2+
# -*- makefile -*-
3+
# ex: set tabstop=4 noexpandtab:
4+
# -*- coding: utf-8 -*
5+
6+
default: help zpc/default
7+
@echo "$@: TODO: Support more than $^ by default"
8+
@date -u
9+
10+
SELF?=${CURDIR}/helper.mk
11+
12+
CMAKE_GENERATOR?=Ninja
13+
export CMAKE_GENERATOR
14+
15+
build_dir?=build
16+
sudo?=sudo
17+
18+
packages?=cmake ninja-build build-essential python3-full ruby clang
19+
packages+=git-lfs unp time file
20+
packages+=nlohmann-json3-dev
21+
# TODO: remove for offline build
22+
packages+=curl wget python3-pip
23+
24+
RUST_VERSION?=1.64.0
25+
export PATH := ${HOME}/.cargo/bin:${PATH}
26+
27+
zpc_exe?=${build_dir}/applications/zpc/zpc
28+
exes+=${zpc_exe}
29+
30+
help: README.md
31+
@cat $<
32+
@echo ""
33+
@echo "# Available rules at your own risk:"
34+
@grep -o '^[^ ]*:' ${SELF} | grep -v '\$$' | grep -v '^#' | grep -v '^\.'
35+
@echo ""
36+
@echo "# Environment:"
37+
@echo "# PATH=${PATH}"
38+
@echo ""
39+
40+
setup/debian: docker/target_dependencies.apt
41+
cat /etc/debian_version
42+
-${sudo} apt update
43+
${sudo} apt install -y $(shell cat $<)
44+
${sudo} apt install -y ${packages}
45+
@echo "$@: TODO: Support debian stable rustc=1.63 https://tracker.debian.org/pkg/rustc"
46+
47+
setup/rust:
48+
@echo "$@: TODO: Support https://tracker.debian.org/pkg/rustup"
49+
curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain ${RUST_VERSION}
50+
cat $${HOME}/.cargo/env
51+
@echo '$@: info: You might like to add ". $${HOME}/.cargo/env" to "$${HOME}/.bashrc"'
52+
-which rustc
53+
rustc --version
54+
cargo --version
55+
@echo "$@: TODO: Support stable version from https://releases.rs/ or older"
56+
57+
setup/python:
58+
@echo "$@: TODO: https://github.com/wbond/pybars3/issues/82"
59+
pip3 --version || echo "warning: Please install pip"
60+
pip3 install --break-system-packages pybars3
61+
62+
setup/debian/12: setup/debian setup/rust setup/python
63+
date -u
64+
65+
setup: setup/debian/12
66+
date -u
67+
68+
git: .git/lfs
69+
git lfs version || echo "$@: warning: Please install git-lfs"
70+
git lfs status --porcelain || git lfs install
71+
time git lfs pull
72+
git lfs update || git lfs update --force
73+
git lfs status --porcelain
74+
75+
configure: ${build_dir}/CMakeCache.txt
76+
file -E $<
77+
78+
${build_dir}/CMakeCache.txt: CMakeLists.txt ${build_pre_list}
79+
cmake -B ${build_dir}
80+
81+
build: ${build_dir}/CMakeCache.txt
82+
cmake --build ${<D} \
83+
|| cat ${build_dir}/CMakeFiles/CMakeOutput.log
84+
cmake --build ${<D}
85+
.PHONY: build
86+
87+
${build_dir}/%: build
88+
file -E "$<"
89+
90+
${exe}: build
91+
file -E $<
92+
93+
all: ${exes}
94+
file -E $<
95+
96+
test: ${build_dir}
97+
ctest --test-dir ${<}
98+
99+
all/default: configure build test
100+
@date -u
101+
102+
zpc/configure: CMakeLists.txt
103+
cmake \
104+
-B ${build_dir} \
105+
-DBUILD_AOXPC=OFF \
106+
-DBUILD_CPCD=OFF \
107+
-DBUILD_DEV_GUI=OFF \
108+
-DBUILD_EMD=OFF \
109+
-DBUILD_EPC=OFF \
110+
-DBUILD_GMS=OFF \
111+
-DBUILD_IMAGE_PROVIDER=OFF \
112+
-DBUILD_NAL=OFF \
113+
-DBUILD_OTBR=OFF \
114+
-DBUILD_POSITIONING=OFF \
115+
-DBUILD_TESTING=ON \
116+
-DBUILD_UPTI_CAP=OFF \
117+
-DBUILD_UPTI_CAP=OFF \
118+
-DBUILD_UPTI_WRITER=OFF \
119+
-DBUILD_UPVL=OFF \
120+
-DBUILD_ZIGBEED=OFF \
121+
-DBUILD_ZIGPC=OFF
122+
123+
zpc/build: zpc/configure build
124+
@date -u
125+
126+
zpc/test: ${build_dir}/applications/zpc/components/zwave_command_classes/test/
127+
ctest --test-dir ${<}
128+
129+
zpc/default: zpc/configure zpc/build
130+
@date -u

0 commit comments

Comments
 (0)