Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Enable github CI for developers forks #21

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*-
# SPDX-License-Identifier: LicenseRef-MSLA
# SPDX-Copyright-Text: (c) 2024 Silicon Laboratories Inc. (www.silabs.com)
---
name: Docker Image CI

on: # yamllint disable-line rule:truthy
push:
pull_request:

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Build Docker image from sources
run: docker build .
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/echo run with: docker build . -f
# SPDX-License-Identifier: LicenseRef-MSLA
# SPDX-Copyright-Text: (c) 2024 Silicon Laboratories Inc. (www.silabs.com)

FROM debian:12

RUN echo "# log: Setup system" \
&& set -x \
&& apt-get update -y \
&& apt-get install -y sudo make \
&& date -u

ENV project wisun-br-linux
ENV workdir /usr/local/src/${project}
WORKDIR ${workdir}
COPY helper.mk ${workdir}
RUN echo "# log: Setup ${project}" \
&& set -x \
&& ./helper.mk setup \
&& date -u

COPY . ${workdir}
WORKDIR ${workdir}
RUN echo "# log: Build ${project}" \
&& set -x \
&& ./helper.mk prepare build \
&& date -u
39 changes: 39 additions & 0 deletions helper.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/make -f
# -*- makefile -*-
# ex: set tabstop=4 noexpandtab:
# -*- coding: utf-8 -*
#
# SPDX-License-Identifier: LicenseRef-MSLA
# SPDX-Copyright-Text: (c) 2024 Silicon Laboratories Inc. (www.silabs.com)

tmpdir?=${CURDIR}/tmp

sudo?=sudo

export CMAKE_PREFIX_PATH=${tmpdir}/usr/local/cmake

debian_packages?=build-essential \
git cmake sudo rustc pkg-config \
libnl-route-3-dev libdbus-1-dev

mbedtls_url?=https://github.com/ARMmbed/mbedtls
mbedtls_rev?=v3.0.0


build:
cmake .
cmake --build .
make install DESTDIR="${tmpdir}"

mbedtls:
git clone --branch=${mbedtls_rev} --recursive --depth=1 ${mbedtls_url}

prepare: mbedtls
cd $< \
&& cmake . \
&& cmake --build . \
&& make install DESTDIR="${tmpdir}"

setup:
${sudo} apt-get install -y ${debian_packages}