-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run RPI integration tests for LedBlinker (#2264)
* Add RPI build workflow * Update workflow to cross-compile * Add RPI_TOOLCHAIN_DIR * Use Setup action * Correct setup action * RPI integration * Install fprime-gds on RPI * activate venv * create log folder * fix paths * Pytest usage * handle logs better * Fix tee usage * final touch * remove push trigger * Use tutorial's devel branch * log to action's output instead of file * GDS --ip-client * Renaming external build workflows * Add get_target_branch to RPI workflow * bombastic side eye
- Loading branch information
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Cross-compile https://github.com/fprime-community/fprime-workshop-led-blinker | ||
# Runs integration tests on RaspberryPi | ||
|
||
name: "RPI LedBlinker" | ||
|
||
on: | ||
push: | ||
branches: [ master, devel ] | ||
pull_request: | ||
branches: [ master, devel ] | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
- '.github/actions/spelling/**' | ||
- '.github/ISSUE_TEMPLATE/**' | ||
|
||
env: | ||
RPI_TOOLCHAIN_DIR: /tmp/rpi-toolchain | ||
|
||
jobs: | ||
get-branch: | ||
name: "Get target branch" | ||
uses: ./.github/workflows/reusable-get-pr-branch.yml | ||
with: | ||
target_repository: fprime-community/fprime-workshop-led-blinker | ||
|
||
cross-compilation: | ||
name: "Cross Compilation" | ||
runs-on: ubuntu-latest | ||
needs: get-branch | ||
steps: | ||
- name: "Checkout target repository" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
repository: fprime-community/fprime-workshop-led-blinker | ||
ref: ${{ needs.get-branch.outputs.target-branch }} | ||
- name: "Overlay current F´ revision" | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
path: ./fprime | ||
fetch-depth: 0 | ||
- uses: ./fprime/.github/actions/setup | ||
with: | ||
location: ./fprime | ||
- name: "Setup RPI Toolchain" | ||
uses: fprime-community/setup-rpi-sysroot@main | ||
- name: "Generate RPI Build Cache" | ||
run: | | ||
fprime-util generate raspberrypi | ||
- name: "Build RPI" | ||
run: | | ||
fprime-util build raspberrypi | ||
- name: "Prepare artifacts" | ||
run: | | ||
mkdir -p rpi-artifacts | ||
cp -r ./build-artifacts rpi-artifacts | ||
cp -r Components/Led/test/int rpi-artifacts | ||
- name: 'Archive Build Artifacts' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rpi-artifacts | ||
path: rpi-artifacts | ||
retention-days: 5 | ||
|
||
RPI-integration: | ||
name: "RPI Integration Tests" | ||
runs-on: self-hosted | ||
needs: cross-compilation | ||
steps: | ||
- name: "Setup environment" | ||
run: | | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip install fprime-gds | ||
- name: "Artifacts Download" | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: rpi-artifacts | ||
- name: Run Integration Tests | ||
run: | | ||
. venv/bin/activate | ||
mkdir -p ci-logs | ||
chmod +x ./build-artifacts/raspberrypi/LedBlinker/bin/LedBlinker | ||
fprime-gds --ip-client -d ./build-artifacts/raspberrypi/LedBlinker --logs ./ci-logs & | ||
sleep 10 | ||
pytest --dictionary ./build-artifacts/raspberrypi/LedBlinker/dict/LedBlinkerTopologyAppDictionary.xml ./int/led_integration_tests.py | ||
- name: 'Archive logs' | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: rpi-logs | ||
path: ci-logs | ||
retention-days: 5 |