Skip to content

Commit 6e485ad

Browse files
committed
Reduce duplication in build action
1 parent 9f4bcaa commit 6e485ad

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

.github/workflows/main-builder.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
build:
1212
strategy:
1313
matrix:
14-
build_type: [v6, v5, v6_esp01]
14+
target: [v6, v5, v6_esp01]
1515
include:
16-
- build_type: v6
16+
- target: v6
1717
branch: main
1818
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
19-
- build_type: v5
19+
- target: v5
2020
branch: main
2121
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEGACY_HARDWARE=1'
22-
- build_type: v6_esp01
22+
- target: v6_esp01
2323
branch: esp-01
2424
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
2525

@@ -28,13 +28,8 @@ jobs:
2828
- name: Download project files
2929
uses: actions/checkout@v4
3030
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
31+
ref: ${{ matrix.branch }}
32+
path: ${{ matrix.branch }}
3833

3934
- name: Cache XC-16 Compiler
4035
id: cache-compiler
@@ -58,23 +53,20 @@ jobs:
5853
5954
- name: Set up cmake-microchip submodules
6055
run: |
61-
cd main
62-
git submodule init
63-
git submodule update
64-
cd ../esp-01
56+
cd ${{ matrix.branch }}
6557
git submodule init
6658
git submodule update
6759
6860
- name: Build firmware
6961
run: |
7062
cd ${{ matrix.branch }}
71-
mkdir build_${{ matrix.build_type }}
72-
cd build_${{ matrix.build_type }}
63+
mkdir build_${{ matrix.target }}
64+
cd build_${{ matrix.target }}
7365
cmake .. ${{ matrix.cmake_flags}}
7466
make
7567
7668
- name: Publish build files
7769
uses: actions/upload-artifact@v4
7870
with:
79-
name: pslab-firmware_${{ matrix.build_type}}
80-
path: ${{ matrix.branch }}/build_${{ matrix.build_type }}/pslab-firmware.hex
71+
name: pslab-firmware_${{ matrix.target}}
72+
path: ${{ matrix.branch }}/build_${{ matrix.target }}/pslab-firmware.hex

0 commit comments

Comments
 (0)