Skip to content

Commit

Permalink
Add docker build step
Browse files Browse the repository at this point in the history
- adds github action build workflow
  • Loading branch information
toban committed Mar 6, 2022
1 parent dee4968 commit 23227b5
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build firmware

on:
push:

pull_request:

jobs:

build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3

- name: Build docker image
run: make lxr-docker-builder

- name: Build firmware
run: |
make firmware-docker
tar -czvf firmware.tar.gz firmware\ image/FIRMWARE.BIN
- name: Archive firmware
uses: actions/upload-artifact@v2
with:
name: Firmware binary
if-no-files-found: error
path: firmware.tar.gz
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
*.bin
*.lss

tools/bin/

!firmware image/FIRMWARE.BIN

#eclipse staging areas
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:trusty

RUN mkdir installing \
&& cd installing \
&& apt-get update \
&& apt-get install curl gcc-avr avr-libc lib32ncurses5 cpio build-essential make --yes \
&& curl -OL https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2

WORKDIR installing

RUN tar xvjf gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 \
&& mv gcc-arm-none-eabi-4_8-2014q1 /opt/ARM \
&& rm gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2

ENV PATH="/opt/ARM/bin:${PATH}"

WORKDIR /app
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ clean:
.PHONY: firmware
firmware: $(IMAGE)

.PHONY: lxr-docker-builder
lxr-docker-builder:
docker build -t lxr-docker-builder .

.PHONY: firmware-docker
firmware-docker: lxr-docker-builder
docker run -v ${PWD}:/app lxr-docker-builder:latest make firmware

$(IMAGE): $(ARM_BINARY) $(AVR_BINARY) $(FIB)
@echo "Building final firmware image $@..."
$(AT)$(FIB) $(ARM_BINARY) $(AVR_BINARY) "$@"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Please note that there are libraries from ST and ARM used in the mainboard code

Many Thanks to user Rudeog who contributet a lot of bugfixes and features for version 0.26 and 0.33 as well as Patrick Dowling for the Makefiles for the Linux build system!

To build the firmware in docker follow these instructions:
----------------------------------------------------------------
You will need:
- docker

```sh
make firmware-docker
```


Instructions for building on Linux using the provided makefiles:
Expand Down

0 comments on commit 23227b5

Please sign in to comment.