-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (95 loc) · 3.18 KB
/
project-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: 'F´ Project Builder Reusable Workflow'
on:
workflow_call:
inputs:
build_location:
description: "Path to F´ module to build. E.g. MyDeployment/"
type: string
required: true
run_unit_tests:
description: "Run an additional job in parallel to run unit tests."
type: boolean
required: false
default: true
fprime_version:
required: false
type: string
description: "F´ version to use. Defaults to project submodule version."
default: ""
fprime_location:
required: false
type: string
description: "Relative path from project root to F´ submodule"
default: "./fprime"
target_platform:
required: false
type: string
description: "F´ build platform (e.g. Linux, Darwin). Default specified in settings.ini."
default: ""
runs_on:
required: false
type: string
description: "runs-on platform. Defaults to ubuntu-latest"
default: "ubuntu-latest"
jobs:
build:
runs-on: ${{ inputs.runs_on }}
name: "Build"
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
submodules: recursive
- if: inputs.fprime_version != ''
name: "Checkout F´ Version"
run: |
cd ${{ inputs.fprime_location }}
git checkout ${{ inputs.fprime_version }}
shell: bash
- name: "Install requirements.txt"
run: |
pip3 install -r ${{ inputs.fprime_location }}/requirements.txt
shell: bash
- name: "Generate build cache"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util generate ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }}
shell: bash
- name: "Build"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util build ${{ runner.debug == '1' && '--verbose' || '' }} ${{ inputs.target_platform }}
shell: bash
runUT:
if: ${{ inputs.run_unit_tests }}
runs-on: ${{ inputs.runs_on }}
name: "Unit Tests"
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
submodules: recursive
- if: inputs.fprime_version != ''
name: "Checkout F´ Version"
run: |
cd ${{ inputs.fprime_location }}
git checkout ${{ inputs.fprime_version }}
shell: bash
- name: "Install requirements.txt"
run: |
pip3 install -r ${{ inputs.fprime_location }}/requirements.txt
- name: "Generate UT build cache"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util generate --ut ${{ runner.debug == '1' && '--verbose' || '' }}
shell: bash
- name: "Build UTs"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util build --ut ${{ runner.debug == '1' && '--verbose' || '' }}
shell: bash
- name: "Run Unit Tests"
working-directory: ${{ inputs.build_location }}
run: |
fprime-util check ${{ runner.debug == '1' && '--verbose' || '' }}
shell: bash