From d208df5616a9b62090eafb4e0c1212fafc30c50f Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Sat, 28 Sep 2024 21:11:28 +0200 Subject: [PATCH] Fix #798, Update build and test workflows to include sample/lab apps + lib --- .github/workflows/build-run-app.yml | 11 ++++++++--- .github/workflows/unit-test-coverage.yml | 10 +++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-run-app.yml b/.github/workflows/build-run-app.yml index 4d94e9980..c33499773 100644 --- a/.github/workflows/build-run-app.yml +++ b/.github/workflows/build-run-app.yml @@ -48,6 +48,7 @@ jobs: run: | echo "APP_UPPER=$(echo ${{ inputs.app-name }} | sed 's/[a-z]/\U&/g')" >> $GITHUB_ENV echo "APP_LOWER=$(echo ${{ inputs.app-name }} | sed 's/[A-Z]/\L&/g')" >> $GITHUB_ENV + echo "IS_SAMPLE_OR_LAB=$(echo ${{ inputs.app-name }} | grep -iqE 'sample|lab' && echo true || echo false)" >> $GITHUB_ENV - name: Set up start string for verification run: | @@ -75,12 +76,16 @@ jobs: - name: Add To Build run: | - sed -i "/list(APPEND MISSION_GLOBAL_APPLIST/a list(APPEND MISSION_GLOBAL_APPLIST $APP_LOWER)" sample_defs/targets.cmake + if [[ "$IS_SAMPLE_OR_LAB" == "false" ]]; then + sed -i "/list(APPEND MISSION_GLOBAL_APPLIST/a list(APPEND MISSION_GLOBAL_APPLIST $APP_LOWER)" sample_defs/targets.cmake + fi - name: Add To Startup run: | - sed -i "1i CFE_APP, $APP_LOWER, ${APP_UPPER}_AppMain, $APP_UPPER, 80, 16384, 0x0, 0;" sample_defs/cpu1_cfe_es_startup.scr - cat sample_defs/cpu1_cfe_es_startup.scr + if [[ "$IS_SAMPLE_OR_LAB" == "false" ]]; then + sed -i "1i CFE_APP, $APP_LOWER, ${APP_UPPER}_AppMain, $APP_UPPER, 80, 16384, 0x0, 0;" sample_defs/cpu1_cfe_es_startup.scr + cat sample_defs/cpu1_cfe_es_startup.scr + fi - name: Make install run: make SIMULATION=native BUILDTYPE=release OMIT_DEPRECATED=true install diff --git a/.github/workflows/unit-test-coverage.yml b/.github/workflows/unit-test-coverage.yml index e24c2af4d..dd3b14184 100644 --- a/.github/workflows/unit-test-coverage.yml +++ b/.github/workflows/unit-test-coverage.yml @@ -5,7 +5,7 @@ on: inputs: # Optional inputs app-name: - description: Application name, if different from repo name + description: Application or library name, if different from repo name type: string required: false default: ${{ github.event.repository.name }} @@ -53,9 +53,11 @@ jobs: - name: Set up environment variables # Apps typically use lowercase targets and uppercase names, this logic is fragile but works + # Also mark sample and lab apps/libraries as we don't need to add those to the build (they're part of the bundle already) run: | echo "APP_UPPER=$(echo ${{ inputs.app-name }} | sed 's/[a-z]/\U&/g')" >> $GITHUB_ENV echo "APP_LOWER=$(echo ${{ inputs.app-name }} | sed 's/[A-Z]/\L&/g')" >> $GITHUB_ENV + echo "IS_SAMPLE_OR_LAB=$(echo ${{ inputs.app-name }} | grep -iqE 'sample|lab' && echo true || echo false)" >> $GITHUB_ENV - name: Checkout Bundle Main uses: actions/checkout@v4 @@ -75,7 +77,9 @@ jobs: - name: Add Repo To Build run: | - sed -i "/list(APPEND MISSION_GLOBAL_APPLIST/a list(APPEND MISSION_GLOBAL_APPLIST $APP_LOWER)" sample_defs/targets.cmake + if [[ "$IS_SAMPLE_OR_LAB" == "false" ]]; then + sed -i "/list(APPEND MISSION_GLOBAL_APPLIST/a list(APPEND MISSION_GLOBAL_APPLIST $APP_LOWER)" sample_defs/targets.cmake + fi - name: Make Prep run: make SIMULATION=native ENABLE_UNIT_TESTS=true OMIT_DEPRECATED=true prep @@ -83,7 +87,7 @@ jobs: - name: Build app build dependencies run: make -C build/tools/elf2cfetbl - - name: Build app target + - name: Build app/library target run: | make -C build/native/default_cpu1/apps/$APP_LOWER