Skip to content
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

Workflow 2612 #24

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
49f9e44
integration-test-2611
rlcheng May 15, 2024
2218d00
integration-test-2611
rlcheng May 28, 2024
1b3e0aa
integration-test-2611
rlcheng Jun 3, 2024
55cae70
integration-test-2611
rlcheng Jun 3, 2024
89afb82
integration-test-2611
rlcheng Jun 4, 2024
70b1ac2
workflow-2612
rlcheng Jun 6, 2024
5119dee
workflow-2612
rlcheng Jun 6, 2024
e68e417
-test
rlcheng Jun 7, 2024
79bfd81
- test
rlcheng Jun 11, 2024
840b3f2
- self hosting test.
rlcheng Jun 11, 2024
031770d
- self host test.
rlcheng Jun 11, 2024
70e709e
- testing 123.
rlcheng Jun 11, 2024
8962185
- build time.
rlcheng Jun 11, 2024
293fbd7
- burn.
rlcheng Jun 11, 2024
bb0f569
- add temp step to rename pde to ino.
rlcheng Jun 11, 2024
44977c4
- start gds
rlcheng Jun 13, 2024
3b66681
- run fit.
rlcheng Jun 13, 2024
16571e2
- int
rlcheng Jun 13, 2024
589ab2f
integration-test-2611
rlcheng Jun 17, 2024
95018ca
integration-test-2611
rlcheng Jun 18, 2024
ab8d341
Merge branch 'integration-test-2611' into workflow-2612
rlcheng Jun 18, 2024
a044bed
integration-test-2611
rlcheng Jun 18, 2024
6739604
Merge branch 'integration-test-2611' into workflow-2612
rlcheng Jun 18, 2024
c6b542a
Merge branch 'main' into workflow-2612
rlcheng Jun 24, 2024
4e66ad5
- workflow test.
rlcheng Jun 24, 2024
10f4abc
- add test artifacts.
rlcheng Jun 26, 2024
2232ebf
workflow-2612
rlcheng Jul 3, 2024
607d4cd
workflow-2612
rlcheng Jul 8, 2024
2de20a3
workflow-2612
rlcheng Jul 11, 2024
390eff9
workflow-2612
rlcheng Jul 15, 2024
3e0a576
workflow-2612
rlcheng Jul 15, 2024
39812cf
workflow-2612
rlcheng Jul 18, 2024
a16ab3e
workflow-2612
rlcheng Jul 18, 2024
929c62b
workflow-2612
rlcheng Jul 24, 2024
d51ade4
workflow-2612
rlcheng Jul 24, 2024
3b64be4
workflow-2612
rlcheng Jul 25, 2024
051e071
workflow-2612
rlcheng Jul 25, 2024
d838063
workflow-2612
rlcheng Jul 29, 2024
5d8dc77
workflow-2612
rlcheng Aug 22, 2024
11ac330
workflow-2612
rlcheng Aug 26, 2024
22bdc56
workflow-2612
rlcheng Aug 26, 2024
4ee39ce
workflow-2612
rlcheng Aug 26, 2024
db381f7
workflow-2612
rlcheng Aug 26, 2024
e1aeeae
workflow-2612
rlcheng Sep 18, 2024
8c91a74
workflow-2612
rlcheng Sep 19, 2024
363f263
workflow-2612
rlcheng Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/baremetal_ci_teensy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: baremetal-ci-actions
run-name: ${{ github.actor }} running Baremetal CI actions
on: [push]

env:
platform_setup: "fsw-gds"
baremetal_bin: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/bin/BaremetalReference.hex
gds_args: --comm-adapter uart --uart-device /dev/ttyACM0
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 }}

jobs:

build:
runs-on: self-hosted
outputs:
platform_setup: ${{ env.platform_setup }}
start_cmd: /home/odroid/teensy_loader_cli/teensy_loader_cli --mcu=TEENSY41 -v -s ${{ env.baremetal_bin }}
gds_args: ${{ env.gds_args }}
dict_path: ${{ env.dict_path }}
test_path: ${{ env.test_path }}
workspace_path: ${{ env.workspace_path }}
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
fprime-util generate
fprime-util build
- 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 }}
105 changes: 105 additions & 0 deletions .github/workflows/reusable_fit_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: resuable-fit

on:
workflow_call:
inputs:
runs_on:
required: false
type: string
default: "ubuntu-latest"
platform_setup:
required: true
type: string
default: "non-embedded"
start_cmd:
required: false
type: string
default: "fprime-gds"
gds_args:
required: false
type: string
dict_path:
required: false
type: string
test_path:
required: false
type: string
workspace_path:
required: true
type: string

jobs:
# Following jobs are on a switch, only one will run based on platform_setup string.
# Each job has a different method of starting FSW, FIT is run at the end of each job.
# If adding a new setup make sure it does not collide with an existing job.
# After one of these jobs is run, the upload FIT artifact job will then run.
#
# / non-embedded \
# build --->| fsw-gds |---> upload-fit-artifacts
# \ gds-fsw /

non-embedded:
if: ${{ inputs.platform_setup == 'non-embedded' }}
runs-on: ${{ inputs.runs_on }}
steps:
- name: "Start FSW and GDS"
run: |
. ./fprime-venv/bin/activate
${{ inputs.start_cmd }}
- name: "Run Integration tests"
run: |
. ./fprime-venv/bin/activate
sleep 12
pytest ${{ inputs.test_path }} --dictionary ${{ inputs.dict_path }} -rP

fsw-gds:
if: ${{ inputs.platform_setup == 'fsw-gds' }}
runs-on: ${{ inputs.runs_on }}
steps:
- 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 }} &
sleep 12
- name: "Run Integration tests"
run: |
. ./fprime-venv/bin/activate
pytest ${{ inputs.test_path }} -rP --dictionary ${{ inputs.dict_path }} --logs ./

gds-fsw:
if: ${{ inputs.platform_setup == 'gds-fsw' }}
runs-on: ${{ inputs.runs_on }}
steps:
- name: "Start GDS"
run: |
. ./fprime-venv/bin/activate
fprime-gds -n --dictionary ${{ inputs.dict_path }} --gui none ${{ inputs.gds_args }} &
- name: "Start FSW"
run: |
${{ inputs.start_cmd }}
sleep 12
- name: "Run Integration tests"
run: |
. ./fprime-venv/bin/activate
pytest ${{ inputs.test_path }} --dictionary ${{ inputs.dict_path }} -rP

upload-fit-artifact:
runs-on: ${{ inputs.runs_on }}
if: ${{ always() }} #as long as one of the above jobs run, this job will run
needs: [non-embedded, fsw-gds, gds-fsw]
steps:
- name: "Upload Integration Test Results"
#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.
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
- uses: actions/upload-artifact@v4
with:
name: TestLog
path: ${{ env.TEST_LOG_PATH }}
62 changes: 31 additions & 31 deletions BaremetalReference/test/int/baremetal_ref_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test_send_command(fprime_test_api):
Tests command send, dispatch, and receipt using a pair of NO_OP commands.
"""
result = fprime_test_api.send_command('cmdDisp.CMD_NO_OP')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_and_assert_command("cmdDisp.CMD_NO_OP", max_delay=10.0)
#Note: send_and_assert_command has issues finding both displatched and completed EVRs. It can only find them if you
Expand All @@ -30,8 +30,8 @@ def test_send_command_with_args(fprime_test_api):
Test command send, dispatch, and receipt using a pair of NO_OP_STRING commands.
"""
result = fprime_test_api.send_command('cmdDisp.CMD_NO_OP_STRING', ['hello'])
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_and_assert_command('cmdDisp.CMD_NO_OP_STRING', ['hola'], max_delay=10.0)

Expand Down Expand Up @@ -65,28 +65,28 @@ def test_event_filter(fprime_test_api):
4. Re-enable activity hi evrs and send BLINKING_ON_OFF back to on, verify evr is no longer filtered.
"""
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['ON'])
result = fprime_test_api.assert_event('SetBlinkingState', timeout = 3)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('SetBlinkingState', timeout = 5)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('eventLogger.SET_EVENT_FILTER', ['ACTIVITY_HI', 'DISABLED'])
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['OFF'])
result = fprime_test_api.await_event_count(0, 'SetBlinkingState')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
#tear down steps. set EVR back to enable and LED back to on.
result = fprime_test_api.send_command('eventLogger.SET_EVENT_FILTER', ['ACTIVITY_HI', 'ENABLED'])
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['ON'])
result = fprime_test_api.await_event_count(1, 'SetBlinkingState')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)

def test_id_filter(fprime_test_api):
"""Test that event can be filtered by ID.
Expand All @@ -99,31 +99,31 @@ def test_id_filter(fprime_test_api):
5. Remove SetBlinkState EVR from the filter list and send BLINKING_ON_OFF back to on.
"""
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['ON'])
result = fprime_test_api.assert_event('SetBlinkingState', timeout = 3)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('SetBlinkingState', timeout = 5)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('eventLogger.SET_ID_FILTER', ['0x10001', 'ENABLED'])
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_ENABLED', timeout = 3)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_ENABLED', timeout = 5)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['ON'])
result = fprime_test_api.await_event_count(0, 'SetBlinkingState')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('eventLogger.SET_ID_FILTER', ['0x10001', 'DISABLED'])
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_REMOVED', timeout = 3)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_REMOVED', timeout = 5)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('eventLogger.SET_ID_FILTER', ['0x100', 'DISABLED'])
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_NOT_FOUND', timeout = 3)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeError')
result = fprime_test_api.assert_event('eventLogger.ID_FILTER_NOT_FOUND', timeout = 5)
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeError', timeout = 5)
time.sleep(3)
result = fprime_test_api.send_command('blinker.BLINKING_ON_OFF', ['ON'])
result = fprime_test_api.await_event_count(1, 'SetBlinkingState')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 3)
result = fprime_test_api.assert_event('OpCodeCompleted')
result = fprime_test_api.assert_event('OpCodeDispatched', timeout = 5)
result = fprime_test_api.assert_event('OpCodeCompleted', timeout = 5)
8 changes: 8 additions & 0 deletions docs/run-baremetal-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ Note: It has to be the full path to the BaremetalReference.hex file for arduino-

4. While programming the red led will be brighter and then flash. Once done the board will get out of HalfKay bootloader mode (red led off) and run the BaremetalReference application. You should now see an orange flashing led by the button.

### Alternate option for hex file upload
Instead of using arduino-cli, you can also use teensy_loader_cli. This alternative is best if you are running on a headless machine / SBC and using SSH. teensy_loader_cli requires compiling on the host machine but usage is simpler.

1. After building the hex file, simply call:
```
teensy_loader_cli --mcu=TEENSY41 -v -s /full_path/fprime-baremetal-reference/build-artifacts/teensy41/BaremetalReference/bin/BaremetalReference.hex
```

## Using GDS via serial
1. Find the serial port, this varies by your host system but it should show up as a `/dev/tty*` device. On the mac, it's /dev/tty.usbmodem*(9 digit number).
2. Launch GDS:
Expand Down