]> git.earman.xyz Git - sensor-watch.git/commitdiff
point build action to new target
authorjoeycastillo <joeycastillo@utexas.edu>
Wed, 18 Sep 2024 13:40:18 +0000 (09:40 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Wed, 18 Sep 2024 13:40:18 +0000 (09:40 -0400)
.github/workflows/build.yml
Makefile

index 84d179a6d5f66c19b6276a279b5e87222898528e..0bf5d2de9471d76b08fbeca6e9f5fa0c9a3a0042 100644 (file)
@@ -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
-        run: make
-        working-directory: 'apps/starter-project'
-      - name: Compile accelerometer-test app
-        run: make
-        working-directory: 'apps/accelerometer-test'
-      - name: Compile movement
+        uses: actions/checkout@v4
+        with:
+          submodules: recursive
+      - name: Compile movement firmware
         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
index ad74e0772cef688939b4da6b3d4801d049dffe60..901abaf74ad4d4441b942aed6ee16ab18b81d053 100644 (file)
--- 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
-