From 5bb833aa28f0445413cd8f240e832cfb17f29754 Mon Sep 17 00:00:00 2001 From: Panagiotis Vasilopoulos Date: Wed, 5 Aug 2020 16:20:06 +0300 Subject: [PATCH 1/4] Added GitHub Actions support - This workflow caches both the Python modules, as well as the arm-none-eabi toolchain itself, in order to save resources and time. - This workflow is meant to imitate the building instructions as closely as possible for every board. After the workflow compiles wasp-os for a specific board, it will package the following in separate archives (per board): - the reloader - the bootloader (both the standalone and the DaFlasher variations) - a copy of MicroPython - a copy of the documentation - the additional tools that are necessary for interacting with devices running on wasp-os Signed-off-by: Panagiotis Vasilopoulos --- .github/workflows/main.yml | 86 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6a1b962 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,86 @@ +name: CI for wasp-os + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + strategy: + matrix: + board: [pinetime, p8] + + runs-on: ubuntu-latest + + steps: + - name: Checkout files + id: checkout-files + uses: actions/checkout@v2 + + - name: Check cached Python modules + id: cache-pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Check the cached arm-none-eabi-gcc compiler + id: cache-toolchain + uses: actions/cache@v2 + env: + cache-name: cache-toolchain + with: + path: ${{ runner.temp }}/arm-none-eabi + key: ${{ runner.os }}-build-${{ env.cache-name }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }} + + - name: Install arm-none-eabi-gcc + id: install-toolchain + # installs arm-none-eabi if the CI environment can't find it in the cache + if: steps.cache-toolchain.outputs.cache-hit != 'true' + uses: fiam/arm-none-eabi-gcc@v1.0.2 + with: + release: 9-2019-q4 + directory: ${{ runner.temp }}/arm-none-eabi + + - name: Make submodules + id: make-submodules + run: | + export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin + make -j BOARD=${{ matrix.board }} submodules + + - name: Make softdevice + id: make-softdevice + run: | + export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin + make -j BOARD=${{ matrix.board }} softdevice + + - name: Build firmware + id: make-firmware + run: | + export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin + make -j BOARD=${{ matrix.board }} all + + - name: Create archive + id: create-archive + run: | + tar -cJf wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz \ + build-${{ matrix.board }} \ + COPYING \ + COPYING.LGPL \ + README.rst \ + TODO.rst \ + tools \ + docs + + - name: Upload build + id: upload-firmware + uses: actions/upload-artifact@v2 + with: + name: wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz + path: wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz + From a851015cea043aab6d6575461e9ae7c7d6fa2254 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Fri, 6 Nov 2020 20:15:45 +0000 Subject: [PATCH 2/4] Makefile: Avoid grabbing lots of pointless submodules Signed-off-by: Daniel Thompson --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 508d316..8cfbe62 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,13 @@ clean : micropython/ports/nrf/build-$(BOARD)-s132 \ wasp/boards/$(BOARD)/watch.py +# Avoid a recursive update... it grabs far too much submodules : - git submodule update --init --recursive + git submodule update --init + (cd bootloader; git submodule update --init) + (cd micropython/ports/nrf; $(MAKE) submodules) + (cd reloader; git submodule update --init) + (cd wasp/modules/bma42x-upy; git submodule update --init) bootloader: build-$(BOARD_SAFE) $(RM) bootloader/_build-$(BOARD)_nrf52832//$(BOARD)_nrf52832_bootloader-*-nosd.hex From 20b626f5c240efbd0ebb24004cf0c00bf8dc65a7 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Fri, 6 Nov 2020 19:49:24 +0000 Subject: [PATCH 3/4] actions: Replace the matrix buils with the makefile dist rule Signed-off-by: Daniel Thompson --- .github/workflows/main.yml | 63 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a1b962..5177329 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI for wasp-os +name: wasp-os binary distribution on: push: @@ -8,10 +8,6 @@ on: jobs: build: - strategy: - matrix: - board: [pinetime, p8] - runs-on: ubuntu-latest steps: @@ -19,15 +15,6 @@ jobs: id: checkout-files uses: actions/checkout@v2 - - name: Check cached Python modules - id: cache-pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Check the cached arm-none-eabi-gcc compiler id: cache-toolchain uses: actions/cache@v2 @@ -47,40 +34,36 @@ jobs: release: 9-2019-q4 directory: ${{ runner.temp }}/arm-none-eabi - - name: Make submodules - id: make-submodules + - name: Install packages + id: install-packages + run: | + sudo apt-get update + sudo apt-get install -y python3-sphinx python3-recommonmark + + - name: Update submodules + id: update-submodules run: | export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin - make -j BOARD=${{ matrix.board }} submodules + make -j `nproc` submodules - - name: Make softdevice - id: make-softdevice + - name: Download softdevice + id: download-softdevice run: | export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin - make -j BOARD=${{ matrix.board }} softdevice + make -j `nproc` softdevice - - name: Build firmware - id: make-firmware + - name: Build wasp-os binary distribution + id: binary-distribution run: | export PATH=$PATH:${{ runner.temp }}/arm-none-eabi/bin - make -j BOARD=${{ matrix.board }} all + make -j `nproc` VERSION=${{ github.sha }} dist + mv ../wasp-os-${{ github.sha }}.tar.gz . - - name: Create archive - id: create-archive - run: | - tar -cJf wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz \ - build-${{ matrix.board }} \ - COPYING \ - COPYING.LGPL \ - README.rst \ - TODO.rst \ - tools \ - docs - - - name: Upload build - id: upload-firmware + - name: Upload binaries + id: upload-binaries uses: actions/upload-artifact@v2 with: - name: wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz - path: wasp-os-${{ github.sha }}-${{ matrix.board }}.tar.gz - + name: wasp-os-${{ github.sha }} + path: | + build-* + wasp-os-${{ github.sha }}.tar.gz From 3423039d35ec38010668132ae11b24b94f8c070a Mon Sep 17 00:00:00 2001 From: Sergio Schvezov Date: Wed, 14 Oct 2020 17:31:40 -0300 Subject: [PATCH 4/4] docs: update building from source apt dependencies The softdevice make target requires unzip Signed-off-by: Sergio Schvezov --- docs/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index a11b654..b003141 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -20,7 +20,7 @@ following commands: sudo apt install \ git build-essential libsdl2-2.0.0 python3-click python3-numpy \ - python3-pexpect python3-pil python3-pip python3-serial + python3-pexpect python3-pil python3-pip python3-serial unzip pip3 install --user pysdl2 Additionally if you wish to regenerate the documentation you will require