Skip to content

Commit

Permalink
Add cache for build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
shamitha-shashidhara committed Nov 25, 2024
1 parent 437ae97 commit 380312b
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build S32k and posix platform

on: [push,pull_request]
on: [push, pull_request]

jobs:
run-command:
Expand All @@ -13,6 +13,17 @@ jobs:
- 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:
Expand All @@ -25,15 +36,13 @@ jobs:
release: '10.3-2021.10'

- name: Configure CMake for POSIX
if: ${{ matrix.platform == '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' }}
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 }}
run: cmake --build cmake-build-${{ matrix.platform }} --target app.referenceApp -j



if: steps.cache-cmake.outputs.cache-hit != 'true'
run: cmake --build cmake-build-${{ matrix.platform }} --target app.referenceApp -j

0 comments on commit 380312b

Please sign in to comment.