mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Ci zephyr (#4141)
* Add reusable action and workflow for CI and set up * Add branch for testing * Call correct workflow * Remove superfluous input (tmp) * Switch to fprime-actions * Add with * Actions typo * Add plugin package installation * Add build stage * Fix container * Remove container * Trial of West * Add custom setup * Add push event * Fix event data mining for push * Fix push payload usage * Fix branch detection * Fix bash-foo * Fix resuable project CI * Add custom runner set up * Typo * Add intgration step * Fix archive download * Debug commands * Download after setup * Fix download path * adding workflow for pico2 zephyr * updated reusable workflow to clean up when done, otherwise garbase is left and it causes issues with subsequent runs * fixing formatting because it matters * Remove erroneous clean-up * sp * Add make space step * Fix review requests --------- Co-authored-by: Kevin F. Ortega <kevin.f.ortega@jpl.nasa.gov>
This commit is contained in:
parent
8ad0b830e8
commit
73ab9621e4
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -61,6 +61,7 @@ Campuzano
|
||||
carg
|
||||
CBF
|
||||
CBLOCK
|
||||
CCACHE
|
||||
CCB
|
||||
CComponent
|
||||
ccsds
|
||||
|
||||
36
.github/workflows/ext-fprime-zephyr-reference-pico2.yml
vendored
Normal file
36
.github/workflows/ext-fprime-zephyr-reference-pico2.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# Cross-compile https://github.com/fprime-community/fprime-zephyr-reference
|
||||
|
||||
name: "External Repo: Zephyr Reference (Pico 2)"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ devel, release/** ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ devel, release/** ]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '.github/actions/spelling/**'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
# Cancel in-progress runs if a newer run is started on a given PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ !contains(github.ref, 'devel') && !contains(github.ref, 'release/')}}
|
||||
jobs:
|
||||
get-branch:
|
||||
name: "Get target branch"
|
||||
uses: ./.github/workflows/reusable-get-pr-branch.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-zephyr-reference
|
||||
|
||||
build:
|
||||
name: "Zephyr Build"
|
||||
needs: get-branch
|
||||
uses: ./.github/workflows/reusable-project-ci.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-zephyr-reference
|
||||
target_ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
ci_config_file: ./lib/fprime-zephyr/ci/sample-configs/pico2.yml
|
||||
|
||||
|
||||
36
.github/workflows/ext-fprime-zephyr-reference-teensy41.yml
vendored
Normal file
36
.github/workflows/ext-fprime-zephyr-reference-teensy41.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# Cross-compile https://github.com/fprime-community/fprime-zephyr-reference
|
||||
|
||||
name: "External Repo: Zephyr Reference (Teensy 4.1)"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ devel, release/** ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ devel, release/** ]
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- '.github/actions/spelling/**'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
# Cancel in-progress runs if a newer run is started on a given PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ !contains(github.ref, 'devel') && !contains(github.ref, 'release/')}}
|
||||
jobs:
|
||||
get-branch:
|
||||
name: "Get target branch"
|
||||
uses: ./.github/workflows/reusable-get-pr-branch.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-zephyr-reference
|
||||
|
||||
build:
|
||||
name: "Zephyr Build"
|
||||
needs: get-branch
|
||||
uses: ./.github/workflows/reusable-project-ci.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-zephyr-reference
|
||||
target_ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
ci_config_file: ./lib/fprime-zephyr/ci/sample-configs/teensy41.yml
|
||||
|
||||
|
||||
10
.github/workflows/reusable-get-pr-branch.yml
vendored
10
.github/workflows/reusable-get-pr-branch.yml
vendored
@ -34,14 +34,16 @@ jobs:
|
||||
- name: "Get target branch"
|
||||
id: get_target_branch
|
||||
run: |
|
||||
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
|
||||
echo "Looking for 'pr-${{ github.event.number }}'/'${BRANCH_NAME}'"
|
||||
response_code_pr=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/pr-${{ github.event.number }} -o /dev/null`
|
||||
response_code_base=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/${{ github.event.pull_request.base.ref }} -o /dev/null`
|
||||
response_code_branch=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/${BRANCH_NAME} -o /dev/null`
|
||||
if [[ "${{ github.event_name }}" == "pull_request" && "$response_code_pr" == "200" ]]; then
|
||||
echo "TARGET_BRANCH=pr-${{ github.event.number }}" >> $GITHUB_OUTPUT
|
||||
echo "PR branch found, using pr-${{ github.event.number }}"
|
||||
elif [[ "${{ github.event_name }}" == "pull_request" && "$response_code_base" == "200" ]]; then
|
||||
echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT
|
||||
echo "Base branch found, using ${{ github.event.pull_request.base.ref }}"
|
||||
elif [[ "$response_code_branch" == "200" ]]; then
|
||||
echo "TARGET_BRANCH=${BRANCH_NAME}" >> $GITHUB_OUTPUT
|
||||
echo "Base branch found, using ${BRANCH_NAME}"
|
||||
else
|
||||
echo "TARGET_BRANCH=${{ inputs.default_target_ref }}" >> $GITHUB_OUTPUT
|
||||
echo "PR branch not found, using ${{ inputs.default_target_ref }}"
|
||||
|
||||
85
.github/workflows/reusable-project-ci.yml
vendored
Normal file
85
.github/workflows/reusable-project-ci.yml
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
# This workflow is intended for reuse by other workflows and will not run directly (no triggers).
|
||||
# The behavior is to run the steps of fprime-ci.
|
||||
name: "F´ CI - Reusable Workflow"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target_repository:
|
||||
description: "Additional external repository to checkout (<owner>/<repo>)"
|
||||
required: true
|
||||
type: string
|
||||
fprime_location:
|
||||
description: "Relative path from the external project root to its F´ submodule"
|
||||
required: false
|
||||
type: string
|
||||
default: "./lib/fprime"
|
||||
target_ref:
|
||||
description: "Branch on target to checkout"
|
||||
required: false
|
||||
type: string
|
||||
default: "devel"
|
||||
ci_config_file:
|
||||
required: true
|
||||
type: string
|
||||
run_unit_tests:
|
||||
description: "Run an additional job in parallel to run unit tests."
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
runs_on:
|
||||
description: "Platform to run on. Defaults to ubuntu-22.04"
|
||||
required: false
|
||||
type: string
|
||||
default: "ubuntu-22.04"
|
||||
runs_on_int:
|
||||
description: "Platform to run integration tests on. Defaults to: apple-ci"
|
||||
required: false
|
||||
type: string
|
||||
default: "apple-ci"
|
||||
runs_on_ut:
|
||||
description: "Platform to run UTs on. Defaults to ubuntu-22.04"
|
||||
required: false
|
||||
type: string
|
||||
default: "ubuntu-22.04"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ inputs.runs_on }}
|
||||
name: "Build"
|
||||
steps:
|
||||
- name: "Make Space"
|
||||
uses: nasa/fprime-actions/make-space@devel
|
||||
- name: "Set up target repository"
|
||||
uses: nasa/fprime-actions/external-repository-setup@devel
|
||||
with:
|
||||
target_repository: ${{ inputs.target_repository }}
|
||||
fprime_location: ${{ inputs.fprime_location }}
|
||||
target_ref: ${{ inputs.target_ref }}
|
||||
stage: build
|
||||
- name: "Build Binary"
|
||||
run: |
|
||||
CCACHE_DISABLE=1 fprime-ci -c ${{ inputs.ci_config_file }} --add-stage build
|
||||
- name: Archive Results
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: archive.tar.gz
|
||||
path: ./archive.tar.gz
|
||||
integration-tests:
|
||||
needs: build
|
||||
name: "Integration Tests"
|
||||
runs-on: ${{ inputs.runs_on_int }}
|
||||
steps:
|
||||
- name: "Set up target repository"
|
||||
uses: nasa/fprime-actions/external-repository-setup@devel
|
||||
with:
|
||||
target_repository: ${{ inputs.target_repository }}
|
||||
fprime_location: ${{ inputs.fprime_location }}
|
||||
target_ref: ${{ inputs.target_ref }}
|
||||
stage: int
|
||||
- name: Pull Archive Results
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: archive.tar.gz
|
||||
- name: "Integration tests"
|
||||
run: |
|
||||
fprime-ci -c ${{ inputs.ci_config_file }} --skip-stage build
|
||||
Loading…
x
Reference in New Issue
Block a user