Skip to content

Commit 36da369

Browse files
committed
Add test actions file
1 parent 11caa69 commit 36da369

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build Firmware
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Build Docker image
21+
run: |
22+
docker build -t s2t-builder:latest -f .devcontainer/Dockerfile .devcontainer/
23+
24+
- name: Configure CMake
25+
run: |
26+
docker run --rm \
27+
-v ${{ github.workspace }}:/workspaces/Speech2Touch \
28+
-w /workspaces/Speech2Touch \
29+
s2t-builder:latest \
30+
/usr/bin/cmake \
31+
-DCMAKE_BUILD_TYPE=Release \
32+
-DCMAKE_TOOLCHAIN_FILE=/workspaces/Speech2Touch/cmake/gcc-arm-none-eabi.cmake \
33+
-S /workspaces/Speech2Touch \
34+
-B /workspaces/Speech2Touch/build/Release \
35+
-G Ninja
36+
37+
- name: Clean build
38+
run: |
39+
docker run --rm \
40+
-v ${{ github.workspace }}:/workspaces/Speech2Touch \
41+
-w /workspaces/Speech2Touch \
42+
s2t-builder:latest \
43+
/usr/bin/cmake --build /workspaces/Speech2Touch/build/Release --target clean --
44+
45+
- name: Build firmware
46+
run: |
47+
docker run --rm \
48+
-v ${{ github.workspace }}:/workspaces/Speech2Touch \
49+
-w /workspaces/Speech2Touch \
50+
s2t-builder:latest \
51+
/usr/bin/cmake --build /workspaces/Speech2Touch/build/Release --target all --
52+
53+
- name: Upload firmware artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: speech2touch-firmware-${{ github.sha }}
57+
path: build/Release/Speech2Touch.bin
58+
if-no-files-found: error
59+
retention-days: 90
60+
61+
- name: Upload firmware artifact (latest)
62+
if: github.ref == 'refs/heads/main'
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: speech2touch-firmware-latest
66+
path: build/Release/Speech2Touch.bin
67+
if-no-files-found: error
68+
retention-days: 90

0 commit comments

Comments
 (0)