From b9c9ec071a0422f14d0b03876601e75a9e86e9e7 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Wed, 18 Sep 2024 09:40:18 -0400 Subject: [PATCH] point build action to new target --- .github/workflows/build.yml | 36 ++++++++++++++---------------------- Makefile | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84d179a6..0bf5d2de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,30 +9,24 @@ on: env: COLOR: BLUE -jobs: +jobs: build: container: image: ghcr.io/armmbed/mbed-os-env:latest runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: Work around CVE-2022-24765 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Compile starter-project app + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Compile movement firmware run: make - working-directory: 'apps/starter-project' - - name: Compile accelerometer-test app - run: make - working-directory: 'apps/accelerometer-test' - - name: Compile movement - run: make - working-directory: 'movement/make' - - name: Upload UF2 + working-directory: '.' + - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: watch.uf2 - path: movement/make/build/watch.uf2 + name: movement.uf2 + path: build/firmware.uf2 build-simulator: container: @@ -40,19 +34,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: Work around CVE-2022-24765 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + uses: actions/checkout@v4 - name: Compile movement run: emmake make - working-directory: 'movement/make' + working-directory: '.' - name: Archive simulator build working-directory: 'movement/make/build-sim' run: | cp watch.html index.html - tar -czf simulator.tar.gz index.html watch.wasm watch.js + tar -czf movement.tar.gz index.html watch.wasm watch.js - name: Upload simulator build uses: actions/upload-artifact@v4 with: - name: simulator.tar.gz - path: movement/make/build-sim/simulator.tar.gz + name: movement.tar.gz + path: build-sim/movement.tar.gz diff --git a/Makefile b/Makefile index ad74e077..901abaf7 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,24 @@ BOARD=sensorwatch_green # Leave this line here. include $(GOSSAMER_PATH)/make.mk +# this is a hack and does not currently work; we need to integrate a bit of +# emscripten support into gossamer to actually build for the simulator +ifdef EMSCRIPTEN +BUILD = ./build-sim +CC = emcc +all: $(BUILD)/$(BIN).html +$(BUILD)/$(BIN).html: $(OBJS) + @echo HTML $@ + @$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ \ + -s ASYNCIFY=1 \ + -s EXPORTED_RUNTIME_METHODS=lengthBytesUTF8,printErr \ + -s EXPORTED_FUNCTIONS=_main \ + --shell-file=$(TOP)/watch-library/simulator/shell.html +endif + # Add your source files here. SRCS += \ ./movement.c \ # Finally, leave this line at the bottom of the file. include $(GOSSAMER_PATH)/rules.mk -