Skip to content

Commit

Permalink
Build MCU target packages only once for the target
Browse files Browse the repository at this point in the history
... instead of once per host as well. Instead, download the slint compiler as needed.
  • Loading branch information
tronical committed Aug 28, 2024
1 parent 3133b4c commit 160a55d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/cpp_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ jobs:
strategy:
matrix:
target: [thumbv7em-none-eabihf]
host: [ubuntu-20.04, windows-2022, macOS-12]

runs-on: ${{ matrix.host }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
Expand All @@ -108,7 +107,7 @@ jobs:
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: CMakeLists.txt
cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=arm-none-eabi-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY ${{ env.SLINT_MCU_FEATURES }}"
cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=arm-none-eabi-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }}"
buildDirectory: ${{ runner.workspace }}/cppbuild
buildWithCMakeArgs: "--config Release"
- name: cpack
Expand All @@ -117,7 +116,7 @@ jobs:
- name: "Upload C++ packages"
uses: actions/upload-artifact@v4
with:
name: cpp_mcu_bin-${{ runner.os }}-${{ runner.arch }}-${{ matrix.target }}
name: cpp_mcu_bin-${{ matrix.target }}
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*

cmake_package_mcu_esp:
Expand All @@ -126,7 +125,6 @@ jobs:
strategy:
matrix:
idf_target: [esp32s2, esp32s3, esp32p4]
host: [ubuntu-22.04, macOS-12]
include:
- idf_target: esp32s2
rust_target: xtensa-esp32s2-none-elf
Expand All @@ -135,7 +133,7 @@ jobs:
- idf_target: esp32p4
rust_target: riscv32imafc-esp-espidf

runs-on: ${{ matrix.host }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
Expand Down Expand Up @@ -166,7 +164,7 @@ jobs:
# NOTE: xtensa-esp-elf-gcc as compiler for the RISC-V targets is wrong, but the compiler argument here is only
# used to ensure that SIZEOF_VOID_P is 4 in the generated cmake config file. Otherwise this build requires no
# C compiler.
cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}"
cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' -DSLINT_COMPILER=download ${{ env.SLINT_MCU_FEATURES }}"
buildDirectory: ${{ runner.workspace }}/cppbuild
buildWithCMakeArgs: "--config Release"
- name: cpack
Expand All @@ -175,7 +173,7 @@ jobs:
- name: "Upload C++ packages"
uses: actions/upload-artifact@v4
with:
name: cpp_mcu_bin-${{ runner.os }}-${{ runner.arch }}-${{ matrix.idf_target }}
name: cpp_mcu_bin-${{ matrix.idf_target }}
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*

cmake_slint_compiler:
Expand Down

0 comments on commit 160a55d

Please sign in to comment.