Skip to content

Commit

Permalink
workflow-2612
Browse files Browse the repository at this point in the history
 - Update resauble_fit_ci to download build artifacts.
 - Add setup job to reusable_fit_ci.
  • Loading branch information
rlcheng committed Sep 23, 2024
1 parent e1aeeae commit 9e5fcf4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 19 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/baremetal_ci_teensy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ env:
dict_path: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/dict/BaremetalReferenceTopologyAppDictionary.xml
test_path: BaremetalReference/test/int/baremetal_ref_integration_test.py
workspace_path: ${{ github.workspace }}
new_baremetal_bin: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/bin/build_binary
new_dict_path: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/dict/dictionary.xml

jobs:

build:
runs-on: ubuntu-latest
outputs:
platform_setup: ${{ env.platform_setup }}
start_cmd: /home/odroid/teensy_loader_cli/teensy_loader_cli --mcu=TEENSY41 -v -s ${{ env.baremetal_bin }}
start_cmd: /home/odroid/teensy_loader_cli/teensy_loader_cli --mcu=TEENSY41 -v -s ./build_binary
gds_args: ${{ env.gds_args }}
dict_path: ${{ env.dict_path }}
test_path: ${{ env.test_path }}
Expand Down Expand Up @@ -52,30 +54,34 @@ jobs:
. ./fprime-venv/bin/activate
fprime-util generate
fprime-util build
- name: "Rename build files"
run: |
mv ${{ env.baremetal_bin }} ${{ env.new_baremetal_bin }}
mv ${{ env.dict_path}} ${{ env.new_dict_path}}
- name: "Upload build binary"
uses: actions/upload-artifact@v4
with:
name: BaremetalReference.hex
path: ${{ env.baremetal_bin }}
name: build_binary
path: ${{ env.new_baremetal_bin }}
- name: "Upload dictionary"
uses: actions/upload-artifact@v4
with:
name: BaremetalReferenceTopologyAppDictionary.xml
path: ${{ env.dict_path }}
name: dictionary.xml
path: ${{ env.new_dict_path }}
#- name: "Temp step, file renaming"
# run: |
# mv ${{ github.workspace }}/lib/arduino/fprime-arduino/ATmega/vendor/libraries/TimerOne/examples/FanSpeed/FanSpeed.pde ${{ github.workspace }}/lib/arduino/fprime-arduino/ATmega/vendor/libraries/TimerOne/examples/FanSpeed/FanSpeed.ino
# mv ${{ github.workspace }}/lib/arduino/fprime-arduino/ATmega/vendor/libraries/TimerOne/examples/Interrupt/Interrupt.pde ${{ github.workspace }}/lib/arduino/fprime-arduino/ATmega/vendor/libraries/TimerOne/examples/Interrupt/Interrupt.ino
- run: echo "Expose env vars for reusable workflow."

# fit:
# needs: build
# uses: ./.github/workflows/reusable_fit_ci.yml
# with:
# runs_on: self-hosted
# platform_setup: ${{ needs.build.outputs.platform_setup }}
# start_cmd: ${{ needs.build.outputs.start_cmd }}
# gds_args: ${{ needs.build.outputs.gds_args }}
# dict_path: ${{ needs.build.outputs.dict_path }}
# test_path: ${{ needs.build.outputs.test_path }}
# workspace_path: ${{ needs.build.outputs.workspace_path }}
fit:
needs: build
uses: ./.github/workflows/reusable_fit_ci.yml
with:
runs_on: self-hosted
platform_setup: ${{ needs.build.outputs.platform_setup }}
start_cmd: ${{ needs.build.outputs.start_cmd }}
gds_args: ${{ needs.build.outputs.gds_args }}
dict_path: ${{ needs.build.outputs.dict_path }}
test_path: ${{ needs.build.outputs.test_path }}
workspace_path: ${{ needs.build.outputs.workspace_path }}
33 changes: 30 additions & 3 deletions .github/workflows/reusable_fit_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,26 @@ jobs:
# build --->| fsw-gds |---> upload-fit-artifacts
# \ gds-fsw /

setup:
runs-on: ${{ inputs.runs_on }}
steps:
- uses: actions/checkout@v4
- name: "Checkout F' Repository"
uses: actions/checkout@v4
with:
submodules: true
path: ${{ inputs.fprime_location }}
- name: "Build"
run: |
python3 -m venv ./fprime-venv
. ./fprime-venv/bin/activate
pip3 install -U setuptools wheel pip
pip3 install -r ${{ inputs.fprime_location }}./fprime/requirements.txt
non-embedded:
if: ${{ inputs.platform_setup == 'non-embedded' }}
runs-on: ${{ inputs.runs_on }}
needs: setup
steps:
- name: "Start FSW and GDS"
run: |
Expand All @@ -54,22 +71,32 @@ jobs:
fsw-gds:
if: ${{ inputs.platform_setup == 'fsw-gds' }}
needs: setup
runs-on: ${{ inputs.runs_on }}
steps:
- name: "Download Binary"
uses: actions/download-artifact@v4
with:
name: build_binary
- name: "Download dictionary"
uses: actions/download-artifact@v4
with:
name: dictionary.xml
- name: "Start FSW"
run: ${{ inputs.start_cmd }}
- name: "Start GDS"
run: |
. ./fprime-venv/bin/activate
fprime-gds -n --dictionary ${{ inputs.dict_path }} --gui none ${{ inputs.gds_args }} &
fprime-gds -n --dictionary ./dictionary.xml --gui none ${{ inputs.gds_args }} &
sleep 12
- name: "Run Integration tests"
run: |
. ./fprime-venv/bin/activate
pytest ${{ inputs.test_path }} -rP --dictionary ${{ inputs.dict_path }} --logs ./
pytest ${{ inputs.test_path }} -rP --dictionary ./dictionary.xml --logs ./
gds-fsw:
if: ${{ inputs.platform_setup == 'gds-fsw' }}
needs: setup
runs-on: ${{ inputs.runs_on }}
steps:
- name: "Start GDS"
Expand All @@ -94,8 +121,8 @@ jobs:
#Navigate to workspace path. nagigate into newest directory, which is for test logs.
#Rename test log because it contains date time and time is separated by colons that upload-artifact cannot handle.
#Store full path to test log xlsx in a variable for upload-artifact to use.
# cd ${{ inputs.workspace_path }}
run: |
cd ${{ inputs.workspace_path }}
cd "$(ls -td -- */ | head -n 1)"
mv TestLog*.xlsx TestLog.xlsx
echo "TEST_LOG_PATH=$(realpath -s *.xlsx)" >> $GITHUB_ENV
Expand Down

0 comments on commit 9e5fcf4

Please sign in to comment.