diff --git a/.github/workflows/baremetal_ci_teensy.yml b/.github/workflows/baremetal_ci_teensy.yml index db0d6299..be0b7bea 100644 --- a/.github/workflows/baremetal_ci_teensy.yml +++ b/.github/workflows/baremetal_ci_teensy.yml @@ -4,12 +4,11 @@ on: [push] env: platform_setup: "fsw-gds" - baremetal_bin: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/bin/BaremetalReference.hex + build_binary: ${{ 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 }} - new_baremetal_bin: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/bin/build_binary + new_build_binary: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/bin/build_binary new_dict_path: ${{ github.workspace }}/build-artifacts/teensy41/BaremetalReference/dict/dictionary.xml jobs: @@ -20,9 +19,7 @@ jobs: platform_setup: ${{ env.platform_setup }} 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 }} - workspace_path: ${{ env.workspace_path }} steps: - uses: actions/checkout@v4 - name: "Checkout F' Repository" @@ -30,13 +27,13 @@ jobs: with: submodules: true path: ${{ inputs.fprime_location }} - - name: "Build" + - name: "Fprime Venv and Requirements Install" 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 - + - name: "Platform Specific Requirements Install" + run: | mkdir -p ~/.local/bin curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh cd ~/.local/bin @@ -50,38 +47,34 @@ jobs: arduino-cli config add board_manager.additional_urls https://www.pjrc.com/teensy/package_teensy_index.json arduino-cli core update-index arduino-cli core install teensy:avr - + - name: "Build" + run: | . ./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.build_binary }} ${{ env.new_build_binary }} mv ${{ env.dict_path}} ${{ env.new_dict_path}} - name: "Upload build binary" uses: actions/upload-artifact@v4 with: name: build_binary - path: ${{ env.new_baremetal_bin }} + path: ${{ env.new_build_binary }} - name: "Upload dictionary" uses: actions/upload-artifact@v4 with: 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: + platform_setup: ${{ needs.build.outputs.platform_setup }} + test_path: ${{ needs.build.outputs.test_path }} 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 }} diff --git a/.github/workflows/reusable_fit_ci.yml b/.github/workflows/reusable_fit_ci.yml index cdea6248..660c8b30 100644 --- a/.github/workflows/reusable_fit_ci.yml +++ b/.github/workflows/reusable_fit_ci.yml @@ -3,39 +3,36 @@ 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 + test_path: + required: true type: string - default: "fprime-gds" - gds_args: + runs_on: required: false type: string - dict_path: + default: "ubuntu-latest" + start_cmd: required: false type: string - test_path: + default: "fprime-gds" + gds_args: required: false type: string - workspace_path: - required: true - type: string + default: "" 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. +# Setup will run first by creating the virtual environment and then downloading the +# FSW binary and dictionary created in the build job step. After that the 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 +# setup --->| fsw-gds |---> upload-fit-artifacts # \ gds-fsw / setup: @@ -47,17 +44,17 @@ jobs: with: submodules: true path: ${{ inputs.fprime_location }} - - name: "Build" + - name: "Install and activate Virtual Environment" 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 - - name: "Download Binary" + - name: "Download FSW Binary" uses: actions/download-artifact@v4 with: name: build_binary - - name: "Download dictionary" + - name: "Download Dictionary" uses: actions/download-artifact@v4 with: name: dictionary.xml @@ -75,7 +72,7 @@ jobs: run: | . ./fprime-venv/bin/activate sleep 12 - pytest ${{ inputs.test_path }} --dictionary ${{ inputs.dict_path }} -rP + pytest ${{ inputs.test_path }} --dictionary ./dictionary.xml -rP fsw-gds: if: ${{ inputs.platform_setup == 'fsw-gds' }} @@ -102,7 +99,7 @@ jobs: - 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 }} & - name: "Start FSW" run: | ${{ inputs.start_cmd }} @@ -110,7 +107,7 @@ jobs: - name: "Run Integration tests" run: | . ./fprime-venv/bin/activate - pytest ${{ inputs.test_path }} --dictionary ${{ inputs.dict_path }} -rP + pytest ${{ inputs.test_path }} --dictionary ./dictionary.xml -rP upload-fit-artifact: runs-on: ${{ inputs.runs_on }} @@ -118,10 +115,9 @@ jobs: 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. + #Navigate 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 "$(ls -td -- */ | head -n 1)" mv TestLog*.xlsx TestLog.xlsx