-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fixes #212, Add unit test workflow #219
Conversation
On hold - Investigate why compile_options were not as expected |
.github/workflows/build-cfs.yml
Outdated
uses: actions/cache@v2 | ||
with: | ||
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* | ||
key: build-${{ github.run_number }}-${{ matrix.buildtype }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an extra item to the cache key to indicate which os you're building for, otherwise you can get a cache collision and unexpected results
.github/workflows/build-cfs.yml
Outdated
uses: actions/cache@v2 | ||
with: | ||
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* | ||
key: build-${{ github.run_number }}-${{ matrix.buildtype }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add cache key for OS
.github/workflows/build-cfs.yml
Outdated
uses: actions/cache@v2 | ||
with: | ||
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/* | ||
key: build-${{ github.run_number }}-${{ matrix.buildtype }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add cache key for OS
We might need to rearchitect this. If one of the builds fails the remaining builds do not run the "Run" or "Unit Test" jobs. This is actually a limmitation on github actions. I have two ideas:
|
aa21622
to
2401ec2
Compare
os: [ubuntu-18.04, ubuntu-20.04] | ||
buildtype: [debug, release] | ||
|
||
# Set the type of machine to run on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment doesn't match action.
- name: Check Coverage | ||
run: make lcov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend breaking up this workflow since it seems to be doing many different things and overlapping other workflows. If the point is to just build and run CF I recommend actually checking for the CF startup message. The 2nd sed
line also could be more generic (just append to the list and simply the search, probably makes more sense appending to MISSION_APP_LIST) and it's not clear why the first one adds at line 7 (seems overly specific).
Doing the entire bundle set of tests and lcov seems like overkill, suggest a separate workflow that just does the unit tests and CF coverage (with enforcement) to both simplify this workflow and avoid the potential of throwing unrelated errors.
2db6ba0
to
080dcde
Compare
.github/workflows/build-cfs.yml
Outdated
|
||
jobs: | ||
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. | ||
check-for-duplicates: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checks for duplicates can run on ubuntu-latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to do the matrix
.github/workflows/build-cfs.yml
Outdated
|
||
jobs: | ||
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action. | ||
check-for-duplicates: | ||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to do the matrix
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04, ubuntu-20.04] | ||
buildtype: [debug, release] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might benefit from a real-time discussion. There's a handful of trades and I'd be interested in talking through it. I still don't think doing the full test and lcov are worth it at the end if the focus of this workflow is to just build and run. Building without unit tests and skipping the tests is going to save a large percentage of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically what I'm trying to say for a unit test workflow within the CF repo, just build and test CF. If you are doing a full build and run, don't do the unit test. Doing a full build with unit tests and running all the unit tests is a big investment for very little likelihood of catching an issue due to CF changes (or even related to CF at all). I'd recommend instead to add a branch at the bundle level that does all the actively maintained apps together, and use that to do the fully integrated set of tests. I have exactly such a branch in my local cFS bundle to do integrated testing. Or instead of a branch you could have a workflow that creates that specific distribution (use a script or build into makefile, it's a simple set of changes) and runs the integrated tests... probably easier to maintain that way.
Changes enable_unit_test to true, changes ctest_output_on_failure to true, Adds repo_name, Adds matrix method to ubuntu-18.04 and ubuntu-20.04 for build,run,test Adds cache key for os, moves build, run, test steps into one job, Removes redundant caches
Closing in favor of #235. Thanks for getting things started! |
Changes enable_unit_test to true, changes ctest_output_on_failure to true,
Adds repo_name, changes ubuntu-latest to ubuntu-18.04, splits build-run
Copied and pasted this file from a successful run
Adds matrix method to ubuntu-18.04 and ubuntu-20.04
Checklist (Please check before submitting)
Describe the contribution
Fixes #212
Testing performed
Testing performed on fork: https://github.com/chillfig/CF/actions/runs/2054990660
Expected behavior changes
Passing workflow
System(s) tested on
Ubuntu 18.04
Ubuntu 20.04
Additional context
The build release tested on Ubuntu 20.04 catches a format truncation warning in nasa/osal. #1241 documents this issue. Passing workflow requires truncation suppression, depends on nasa/cFE#2078.
Contributor Info - All information REQUIRED for consideration of pull request
Justin Figueroa, ASRC Federal