forked from nasa/fprime
-
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.
Build fprime-community projects as part of CI checks (nasa#2049)
* Added reusable-builder workflow * Added build-led-blinker * On push/PR * not running integration_tests yet * fix booleans * add optional target platform * For once, spelling was nice with me * misc formatting * Review recommendations * fix usage
- Loading branch information
1 parent
eac5930
commit a81f70f
Showing
2 changed files
with
120 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Builds and runs UTs on https://github.com/fprime-community/fprime-workshop-led-blinker | ||
|
||
name: "LedBlinker Tests" | ||
|
||
on: | ||
push: | ||
branches: [ master, devel ] | ||
pull_request: | ||
branches: [ master, devel ] | ||
|
||
jobs: | ||
run: | ||
name: "" | ||
uses: ./.github/workflows/reusable-builder.yml | ||
with: | ||
target_repository: fprime-community/fprime-workshop-led-blinker | ||
build_location: LedBlinker | ||
run_unit_tests: true |
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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# This workflow is intended for reuse by other workflows and will not run directly (no triggers). | ||
# The behavior is to build an external F´ project (e.g. fprime-community/system-reference) using | ||
# the current F´ version. | ||
name: "F´ Project Builder - Reusable Workflow" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
build_location: | ||
description: "Path to F´ module to build. E.g. MyDeployment/" | ||
required: true | ||
type: string | ||
target_repository: | ||
description: "Additional external repository to checkout (<owner>/<repo>)" | ||
required: true | ||
type: string | ||
run_unit_tests: | ||
description: "Run an additional job in parallel to run unit tests." | ||
required: false | ||
type: boolean | ||
default: true | ||
fprime_location: | ||
description: "Relative path from the external project root to its F´ submodule" | ||
required: false | ||
type: string | ||
default: "./fprime" | ||
runs_on: | ||
description: "Platform to run on. Defaults to ubuntu-latest" | ||
required: false | ||
type: string | ||
default: "ubuntu-latest" | ||
target_platform: | ||
description: "Target platform to pass to fprime-util" | ||
required: false | ||
type: string | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ inputs.runs_on }} | ||
name: "Build" | ||
steps: | ||
- name: "Checkout target repository" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
repository: ${{ inputs.target_repository }} | ||
- name: "Overlay current F´ revision" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
path: ${{ inputs.fprime_location }} | ||
- name: "Install requirements.txt" | ||
run: | | ||
pip3 install -r ${{ inputs.fprime_location }}/requirements.txt | ||
shell: bash | ||
- name: "Generate build cache" | ||
working-directory: ${{ inputs.build_location }} | ||
run: | | ||
fprime-util generate ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }} | ||
shell: bash | ||
- name: "Build" | ||
working-directory: ${{ inputs.build_location }} | ||
run: | | ||
fprime-util build ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }} | ||
shell: bash | ||
|
||
runUT: | ||
if: ${{ inputs.run_unit_tests }} | ||
runs-on: ${{ inputs.runs_on }} | ||
name: "Unit Tests" | ||
steps: | ||
- name: "Checkout target repository" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
repository: ${{ inputs.target_repository }} | ||
- name: "Overlay current F´ revision" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
path: ${{ inputs.fprime_location }} | ||
- name: "Install requirements.txt" | ||
run: | | ||
pip3 install -r ${{ inputs.fprime_location }}/requirements.txt | ||
shell: bash | ||
- name: "Generate UT build cache" | ||
working-directory: ${{ inputs.build_location }} | ||
run: | | ||
fprime-util generate --ut ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }} | ||
shell: bash | ||
- name: "Build UTs" | ||
working-directory: ${{ inputs.build_location }} | ||
run: | | ||
fprime-util build --ut ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }} | ||
shell: bash | ||
- name: "Run Unit Tests" | ||
working-directory: ${{ inputs.build_location }} | ||
run: | | ||
fprime-util check ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }} | ||
shell: bash | ||
|