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

Add Validate Templates (#2387) #2990

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/bootstrap.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set timeout 180
spawn fprime-bootstrap project
expect "Project name (MyProject):"
send "MyProject\r"
expect eof
24 changes: 24 additions & 0 deletions .github/workflows/component.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set timeout 60
spawn fprime-util new --component
expect -re {.*Component name.*}
send "MyComponent\r"
expect -re {.*Component short description.*}
send "test component\r"
expect -re {.*Component namespace.*}
send "Components\r"
expect -re {.*Select component kind}
send "1\r"
expect -re {.*Enable Commands.*}
send "1\r"
expect -re {.*Enable Telemetry.*}
send "1\r"
expect -re {.*Enable Events.*}
send "1\r"
expect -re {.*Enable Parameters.*}
send "1\r"
expect -re {Add MyComponent to.*}
send "yes\r"
expect -re {Generate implementation files.*}
send "yes\r"
expect -re {.*Created new component.*}
expect eof
9 changes: 9 additions & 0 deletions .github/workflows/deployment.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set timeout 60
spawn fprime-util new --deployment
expect -re {Deployment name.*}
send "MyDeployment\r"
expect -re {.*Select communication driver type}
send "1\r"
expect -re "Add MyDeployment.*"
send "yes\r"
expect eof
53 changes: 53 additions & 0 deletions .github/workflows/validate_templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: validate_templates-actions
run-name: ${{ github.actor }} running Validate Templates CI actions
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/**'

jobs:

validate_templates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Checkout F' Repository"
uses: actions/checkout@v4
with:
submodules: true
path: ${{ inputs.fprime_location }}

- name: "Test Bootstrap and build"
run: |
pip install fprime-bootstrap
sudo apt-get install expect
mkdir test_dev
cd test_dev
expect ../.github/workflows/bootstrap.exp
LeStarch marked this conversation as resolved.
Show resolved Hide resolved
cd MyProject
. fprime-venv/bin/activate
fprime-util generate
fprime-util build

- name: "Test Deployment and build"
run: |
cd test_dev/MyProject
. fprime-venv/bin/activate
expect ../../.github/workflows/deployment.exp
cd MyDeployment
fprime-util build
LeStarch marked this conversation as resolved.
Show resolved Hide resolved

- name: "Test Component and build"
run: |
cd test_dev/MyProject
. fprime-venv/bin/activate
expect ../../.github/workflows/component.exp
cd MyComponent
fprime-util build
LeStarch marked this conversation as resolved.
Show resolved Hide resolved
Loading