Skip to content

Update defaults to speed up transactions #53

Update defaults to speed up transactions

Update defaults to speed up transactions #53

# This workflow is intended for reuse by other workflows and will not run directly (no triggers).

Check failure on line 1 in .github/workflows/reusable-project-builder.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable-project-builder.yml

Invalid workflow file

(Line: 51, Col: 21): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.debug == '1' && '--verbose' || '', (Line: 86, Col: 21): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.debug == '1' && '--verbose' || ''
# 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-22.04"
required: false
type: string
default: "ubuntu-22.04"
target_platform:
description: "Target platform to pass to fprime-util"
required: false
type: string
default: ""
target_ref:
description: "Branch on target to checkout"
required: false
type: string
default: "devel"
jobs:
build:
runs-on: ${{ inputs.runs_on }}
name: "Build"
env:
FPRIME_LOCATION: ${{ inputs.fprime_location }}
TARGET_PLATFORM: ${{ inputs.target_platform }}
VERBOSE_FLAG: ${{ runner.debug == '1' && '--verbose' || '' }}
steps:
- name: "Checkout target repository"
uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repository }}
ref: ${{ inputs.target_ref }}
- name: "Overlay current F´ revision"
uses: actions/checkout@v4
with:
submodules: true
path: ${{ inputs.fprime_location }}
- name: "Install requirements.txt"
run: |
pip3 install -r ${FPRIME_LOCATION}/requirements.txt
shell: bash
- name: "Generate build cache"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util generate ${VERBOSE_FLAG} ${TARGET_PLATFORM}
shell: bash
- name: "Build"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util build -j8 ${VERBOSE_FLAG} ${TARGET_PLATFORM}
shell: bash
runUT:
if: ${{ inputs.run_unit_tests }}
runs-on: ${{ inputs.runs_on }}
name: "Unit Tests"
env:
FPRIME_LOCATION: ${{ inputs.fprime_location }}
TARGET_PLATFORM: ${{ inputs.target_platform }}
VERBOSE_FLAG: ${{ runner.debug == '1' && '--verbose' || '' }}
steps:
- name: "Checkout target repository"
uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repository }}
ref: ${{ inputs.target_ref }}
- name: "Overlay current F´ revision"
uses: actions/checkout@v4
with:
submodules: true
path: ${{ inputs.fprime_location }}
- name: "Install requirements.txt"
run: |
pip3 install -r ${FPRIME_LOCATION}/requirements.txt
shell: bash
- name: "Generate UT build cache"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util generate --ut ${VERBOSE_FLAG} ${TARGET_PLATFORM}
shell: bash
- name: "Build UTs"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util build --ut -j8 ${VERBOSE_FLAG} ${TARGET_PLATFORM}
shell: bash
- name: "Run Unit Tests"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util check -j8 ${VERBOSE_FLAG} ${TARGET_PLATFORM}
shell: bash