forked from eclipse-openbsw/openbsw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf66fdc
commit c00c716
Showing
1 changed file
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,48 @@ | ||
name: CMake on a single platform | ||
name: Build S32k and posix platform | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
run-command: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [posix, s32k148] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup cmake | ||
uses: jwlawson/actions-setup-cmake@v2 | ||
with: | ||
cmake-version: '3.22.x' | ||
- name: Configure CMake | ||
run: cmake -B cmake-build-posix -S executables/referenceApp -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
run: cmake --build cmake-build-posix --target app.referenceApp -j --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Test | ||
# Execute tests defined by the CMake configuration. | ||
run: | | ||
cmake -B cmake-build-unit-tests -S executables/unitTest -DBUILD_UNIT_TESTS=ON | ||
cmake --build cmake-build-unit-tests -j4 | ||
ctest --test-dir cmake-build-unit-tests -j4 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache CMake files | ||
id: cache-cmake | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
cmake-build-posix | ||
cmake-build-s32k148 | ||
key: ${{ runner.os }}-cmake-${{ matrix.platform }}-${{ hashFiles('**/*.cpp', '**/*.h', '**/*.cmake', '**/*.txt', '**/*.c', '**/*.s', 'admin/cmake/ArmNoneEabi.cmake') }} | ||
restore-keys: | | ||
${{ runner.os }}-cmake-${{ matrix.platform }}- | ||
- name: Set up CMake | ||
uses: jwlawson/actions-setup-cmake@v2 | ||
with: | ||
cmake-version: '3.22.x' | ||
|
||
- name: Set up ARM GCC | ||
if: ${{ matrix.platform == 's32k148' }} | ||
uses: carlosperate/arm-none-eabi-gcc-action@v1 | ||
with: | ||
release: '10.3-2021.10' | ||
|
||
- name: Configure CMake for POSIX | ||
if: ${{ matrix.platform == 'posix' && steps.cache-cmake.outputs.cache-hit != 'true' }} | ||
run: cmake -B cmake-build-posix -S executables/referenceApp | ||
|
||
- name: Configure CMake for S32K148 | ||
if: ${{ matrix.platform == 's32k148' && steps.cache-cmake.outputs.cache-hit != 'true' }} | ||
run: cmake -B cmake-build-s32k148 -S executables/referenceApp -DBUILD_TARGET_PLATFORM="S32K148EVB" --toolchain ../../admin/cmake/ArmNoneEabi.cmake | ||
|
||
- name: Build for ${{ matrix.platform }} | ||
if: steps.cache-cmake.outputs.cache-hit != 'true' | ||
run: cmake --build cmake-build-${{ matrix.platform }} --target app.referenceApp -j |