Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #798, Update build/test workflows to include sample/lab apps #799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/build-run-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ jobs:
steps:
- name: Set up environment variables
# Apps typically use lowercase targets and uppercase names, this logic is fragile but works
# Mark the sample app/lib and lab apps as we don't need to add them to the build or startup file (they're already part of the bundle)
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only (slight) concern is with this logic. I can see why you did this -- that the "sample" and "lab" apps are already in the sample config, thus we need to not add them again or else we'd end up with a duplicate entry.

My concern is that this will break if someone changes the sample config such that this assumption is not true anymore. I also don't want to assume that there will never be another app with either "sample" or "lab" in its name.

Could we do something more direct -- that is, instead of checking the app name, check if the script already has the entry? That is, if running on "to_lab" -- just check if the cfe_es_startup.scr already has an entry for to_lab, and skip the update if it does?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least -- another idea is could this be a parameter that is passed into the workflow? Something like "is_framework_app" ... with a default value of false. Then when TO/CI/SCH Lab and Sample App invoke this workflow, they can pass it as true, but everything else remains as it was. This would accomplish the same goal without making this assumption.


- name: Set up start string for verification
run: |
Expand Down Expand Up @@ -75,12 +77,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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/unit-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -53,9 +53,11 @@ jobs:

- name: Set up environment variables
# Apps typically use lowercase targets and uppercase names, this logic is fragile but works
# Mark the sample app/lib and lab apps as we don't need to add them to the build or startup file (they're already part of the bundle)
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
Expand All @@ -75,15 +77,17 @@ 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

- 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

Expand Down
Loading