-
Notifications
You must be signed in to change notification settings - Fork 78
80 lines (70 loc) · 2.48 KB
/
main-builder.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
name: pslab-firmware
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
jobs:
build:
strategy:
matrix:
build_type: [v6, v5, v6_esp01]
include:
- build_type: v6
branch: main
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
- build_type: v5
branch: main
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEGACY_HARDWARE=1'
- build_type: v6_esp01
branch: esp-01
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
runs-on: ubuntu-latest
steps:
- name: Download project files
uses: actions/checkout@v4
with:
path: main
- name: Checkout ESP01 branch
uses: actions/checkout@v4
with:
ref: esp-01
path: esp-01
- name: Cache XC-16 Compiler
id: cache-compiler
uses: actions/cache@v3
with:
path: ~/.cache/mplab-xc
key: xc16-v2.10-cache
- name: Download XC16 Compiler
if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/mplab-xc
cd ~/.cache/mplab-xc
wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc16-v2.10-full-install-linux64-installer.run
chmod +x xc16-v2.10-full-install-linux64-installer.run
- name: Install XC16 Compiler
run: |
cd ~/.cache/mplab-xc
sudo ./xc16-v2.10-full-install-linux64-installer.run --mode unattended --netservername dontknow
- name: Set up cmake-microchip submodules
run: |
cd main
git submodule init
git submodule update
cd ../esp-01
git submodule init
git submodule update
- name: Build firmware
run: |
cd ${{ matrix.branch }}
mkdir build_${{ matrix.build_type }}
cd build_${{ matrix.build_type }}
cmake .. ${{ matrix.cmake_flags}}
make
- name: Publish build files
uses: actions/upload-artifact@v4
with:
name: pslab-firmware_${{ matrix.build_type}}
path: ${{ matrix.branch }}/build_${{ matrix.build_type }}/pslab-firmware.hex