-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.16 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CMake
on:
push:
release:
types: [published]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
name: ${{matrix.name}}
strategy:
matrix:
include:
- os: ubuntu-20.04
name: Linux
cmake-args: '-DPICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk -DPICO_SDK_POST_LIST_DIRS=$GITHUB_WORKSPACE/pico-extras'
apt-packages: gcc-arm-none-eabi
runs-on: ${{matrix.os}}
env:
PICO_SDK_PATH: $GITHUB_WORKSPACE/pico-sdk
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Check out the Pico SDK
- name: Checkout Pico SDK
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
path: pico-sdk
submodules: true
# Check out the Pico Extras
- name: Checkout Pico Extras
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-extras
path: pico-extras
submodules: false # lwip breaks audio submodule fetching
# Linux deps
- name: Install deps
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install ${{matrix.apt-packages}}
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE ${{matrix.cmake-args}}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --build . --config $BUILD_TYPE -j 2
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: main.elf
path: ${{runner.workspace}}/build/main.elf
- name: Upload elf to GH release page
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' && github.repository == 'Pioreactor/pico-build'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{runner.workspace}}/build/main.elf
tag: ${{ github.ref }}
overwrite: true
file_glob: true