浏览代码

GitHub Actions (#1)

* try gh action build

* add cxxtest dependency

* more dependencies for build

* and another dependency
Thomas Buck 5 个月前
父节点
当前提交
49b851e1b4
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 61 次插入0 次删除
  1. 61
    0
      .github/workflows/cmake.yml

+ 61
- 0
.github/workflows/cmake.yml 查看文件

@@ -0,0 +1,61 @@
1
+# https://github.com/raspberrypi/pico-examples/blob/master/.github/workflows/cmake.yml
2
+
3
+name: CMake
4
+on: [push, pull_request]
5
+
6
+env:
7
+  BUILD_TYPE: Release
8
+
9
+jobs:
10
+  build:
11
+    runs-on: ubuntu-latest
12
+
13
+    steps:
14
+    - name: Install dependencies
15
+      run: sudo apt-get install -y cxxtest build-essential gcc-arm-none-eabi mtools
16
+
17
+    - name: Checkout repo
18
+      uses: actions/checkout@v3
19
+      with:
20
+        path: repo
21
+
22
+    - name: Checkout repo submodules
23
+      working-directory: ${{github.workspace}}/repo
24
+      run: git submodule update --init
25
+
26
+    - name: Checkout pico-sdk submodules
27
+      working-directory: ${{github.workspace}}/repo/pico-sdk
28
+      run: git submodule update --init
29
+
30
+    - name: Create Build Environment
31
+      working-directory: ${{github.workspace}}/repo
32
+      run:  cmake -E make_directory ${{github.workspace}}/repo/build
33
+
34
+    - name: Configure CMake
35
+      shell: bash
36
+      working-directory: ${{github.workspace}}/repo/build
37
+      run: cmake .. -DPICO_BOARD=pico_w -DCMAKE_BUILD_TYPE=$BUILD_TYPE
38
+
39
+    - name: Get core count
40
+      id: core_count
41
+      run : cat /proc/cpuinfo  | grep processor | wc -l
42
+
43
+    - name: Build
44
+      working-directory: ${{github.workspace}}/repo/build
45
+      shell: bash
46
+      # Execute the build.  You can specify a specific target with "--target <NAME>"
47
+      run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)
48
+
49
+    - name: Upload a Build Artifact
50
+      uses: actions/upload-artifact@v4.0.0
51
+      with:
52
+        name: firmware.uf2
53
+        path: ${{github.workspace}}/repo/build/picowota_gadget.uf2
54
+        if-no-files-found: error
55
+
56
+    - name: Upload a Build Artifact
57
+      uses: actions/upload-artifact@v4.0.0
58
+      with:
59
+        name: update.elf
60
+        path: ${{github.workspace}}/repo/build/gadget.elf
61
+        if-no-files-found: error

正在加载...
取消
保存