|
5 | 5 | branches: [ main ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
| 8 | + workflow_call: |
8 | 9 |
|
9 | 10 | jobs: |
10 | 11 | build: |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - name: Download project files |
14 | | - uses: actions/checkout@v3 |
15 | | - |
16 | | - - name: Cache XC-16 Compiler |
17 | | - id: cache-compiler |
18 | | - uses: actions/cache@v3 |
19 | | - with: |
20 | | - path: ~/.cache/mplab-xc |
21 | | - key: xc16-v2.10-cache |
22 | | - |
23 | | - - name: Download XC16 Compiler |
24 | | - if: steps.cache-compiler.outputs.cache-hit != 'true' |
25 | | - run: | |
26 | | - mkdir -p ~/.cache/mplab-xc |
27 | | - cd ~/.cache/mplab-xc |
28 | | - wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc16-v2.10-full-install-linux64-installer.run |
29 | | - chmod +x xc16-v2.10-full-install-linux64-installer.run |
30 | | -
|
31 | | - - name: Install XC16 Compiler |
32 | | - run: | |
33 | | - cd ~/.cache/mplab-xc |
34 | | - sudo ./xc16-v2.10-full-install-linux64-installer.run --mode unattended --netservername dontknow |
35 | | -
|
36 | | - - name: Set up cmake-microchip submodules |
37 | | - run: | |
38 | | - git submodule init |
39 | | - git submodule update |
40 | | -
|
41 | | - - name: Build firmware |
42 | | - run: | |
43 | | - mkdir build |
44 | | - cd build |
45 | | - cmake .. |
46 | | - make |
47 | | -
|
48 | | - - name: Publish build files |
49 | | - uses: actions/upload-artifact@v4 |
50 | | - with: |
51 | | - name: production-file |
52 | | - path: build/*.hex |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + build_type: [v6, v5, v6_esp01] |
| 15 | + include: |
| 16 | + - build_type: v6 |
| 17 | + branch: main |
| 18 | + cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo' |
| 19 | + - build_type: v5 |
| 20 | + branch: main |
| 21 | + cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEGACY_HARDWARE=1' |
| 22 | + - build_type: v6_esp01 |
| 23 | + branch: esp-01 |
| 24 | + cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo' |
| 25 | + |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - name: Download project files |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + path: main |
| 32 | + |
| 33 | + - name: Checkout ESP01 branch |
| 34 | + uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + ref: esp-01 |
| 37 | + path: esp-01 |
| 38 | + |
| 39 | + - name: Cache XC-16 Compiler |
| 40 | + id: cache-compiler |
| 41 | + uses: actions/cache@v3 |
| 42 | + with: |
| 43 | + path: ~/.cache/mplab-xc |
| 44 | + key: xc16-v2.10-cache |
| 45 | + |
| 46 | + - name: Download XC16 Compiler |
| 47 | + if: steps.cache-compiler.outputs.cache-hit != 'true' |
| 48 | + run: | |
| 49 | + mkdir -p ~/.cache/mplab-xc |
| 50 | + cd ~/.cache/mplab-xc |
| 51 | + wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc16-v2.10-full-install-linux64-installer.run |
| 52 | + chmod +x xc16-v2.10-full-install-linux64-installer.run |
| 53 | +
|
| 54 | + - name: Install XC16 Compiler |
| 55 | + run: | |
| 56 | + cd ~/.cache/mplab-xc |
| 57 | + sudo ./xc16-v2.10-full-install-linux64-installer.run --mode unattended --netservername dontknow |
| 58 | +
|
| 59 | + - name: Set up cmake-microchip submodules |
| 60 | + run: | |
| 61 | + cd main |
| 62 | + git submodule init |
| 63 | + git submodule update |
| 64 | + cd ../esp-01 |
| 65 | + git submodule init |
| 66 | + git submodule update |
| 67 | +
|
| 68 | + - name: Build firmware |
| 69 | + run: | |
| 70 | + cd ${{ matrix.branch }} |
| 71 | + mkdir build_${{ matrix.build_type }} |
| 72 | + cd build_${{ matrix.build_type }} |
| 73 | + cmake .. ${{ matrix.cmake_flags}} |
| 74 | + make |
| 75 | +
|
| 76 | + - name: Publish build files |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + with: |
| 79 | + name: pslab-firmware_${{ matrix.build_type}} |
| 80 | + path: ${{ matrix.branch }}/build_${{ matrix.build_type }}/pslab-firmware.hex |
0 commit comments