diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..8945b22
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,30 @@
+name: CI
+
+on:
+ pull_request:
+ push:
+ branches:
+ - 'main'
+ - 'feature/*'
+
+jobs:
+ pre-commit:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ - name: Cache Docker layers
+ uses: actions/cache@v3
+ with:
+ path: /tmp/.buildx-cache
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-buildx-
+
+ - name: Build Docker Image
+ run: docker build --output=out .
+
+ - uses: actions/setup-python@v3
+ - uses: pre-commit/action@v3.0.1
diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml
deleted file mode 100644
index 2b11178..0000000
--- a/.github/workflows/pre-commit.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: pre-commit
-
-on:
- pull_request:
- push:
- branches: [main]
-
-jobs:
- pre-commit:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v3
- - uses: pre-commit/action@v3.0.1
diff --git a/bootloader/.dockerignore b/bootloader/.dockerignore
new file mode 100644
index 0000000..fdd2db4
--- /dev/null
+++ b/bootloader/.dockerignore
@@ -0,0 +1,5 @@
+.dep
+build
+.idea
+out
+Dockerfile
diff --git a/bootloader/.gitignore b/bootloader/.gitignore
index 40b0a8f..afb25a2 100644
--- a/bootloader/.gitignore
+++ b/bootloader/.gitignore
@@ -1,3 +1,4 @@
cmake-build-debug/
build/
.dep/
+out/
diff --git a/bootloader/.idea/codeStyles/Project.xml b/bootloader/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..5316267
--- /dev/null
+++ b/bootloader/.idea/codeStyles/Project.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bootloader/.idea/codeStyles/codeStyleConfig.xml b/bootloader/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/bootloader/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/bootloader/.idea/editor.xml b/bootloader/.idea/editor.xml
index 66c8679..473c2bb 100644
--- a/bootloader/.idea/editor.xml
+++ b/bootloader/.idea/editor.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/bootloader/.idea/misc.xml b/bootloader/.idea/misc.xml
index c28b432..42bf49e 100644
--- a/bootloader/.idea/misc.xml
+++ b/bootloader/.idea/misc.xml
@@ -2,6 +2,7 @@
+
diff --git a/bootloader/.idea/vcs.xml b/bootloader/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/bootloader/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bootloader/Dockerfile b/bootloader/Dockerfile
new file mode 100644
index 0000000..7c704b5
--- /dev/null
+++ b/bootloader/Dockerfile
@@ -0,0 +1,17 @@
+FROM ubuntu:22.04 AS builder
+LABEL authors="Clemens Elflein"
+
+RUN apt-get update && apt-get install -y \
+ gcc-arm-none-eabi \
+ make \
+ && rm -rf /var/lib/apt/lists/*
+
+COPY . /project
+
+WORKDIR /project
+RUN make -j$(nproc)
+
+
+FROM scratch
+COPY --from=builder /project/build/xcore-boot.elf /
+COPY --from=builder /project/build/xcore-boot.bin /
diff --git a/bootloader/build-binary.sh b/bootloader/build-binary.sh
new file mode 100755
index 0000000..6d0e262
--- /dev/null
+++ b/bootloader/build-binary.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+docker build --output=out .
diff --git a/bootloader/main.c b/bootloader/main.c
index f1d5c17..64e8b71 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -1,3 +1,8 @@
+// clang-format off
+#include "ch.h"
+#include "hal.h"
+// clang-format on
+
#include
#include
#include
@@ -5,8 +10,6 @@
#include
#include
-#include "ch.h"
-#include "hal.h"
#include "lwipthread.h"
/*
diff --git a/bootloader/src/bootloader.c b/bootloader/src/bootloader.c
index 81cfab8..e10ad19 100644
--- a/bootloader/src/bootloader.c
+++ b/bootloader/src/bootloader.c
@@ -1,11 +1,15 @@
#include "bootloader.h"
+// clang-format off
+#include "ch.h"
+#include "hal.h"
+// clang-format on
+
#include
#include
#include
#include "board_ex.h"
-#include "ch.h"
#include "chprintf.h"
#include "globals.h"
#include "lwip/sockets.h"
diff --git a/bootloader/src/service_discovery.c b/bootloader/src/service_discovery.c
index bfba3b6..c763ccd 100644
--- a/bootloader/src/service_discovery.c
+++ b/bootloader/src/service_discovery.c
@@ -4,11 +4,14 @@
#include "service_discovery.h"
+// clang-format off
+#include "ch.h"
+#include "hal.h"
+// clang-format on
+
#include
-#include "ch.h"
#include "chprintf.h"
-#include "hal.h"
#include "lwip/sockets.h"
static char boardAdvertisementBuffer[1000];