Skip to content

Commit c48c18c

Browse files
committed
ci(gha): add hst workflows and actions
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
1 parent 9039a8a commit c48c18c

8 files changed

Lines changed: 352 additions & 35 deletions

File tree

.github/actions/vpp-build/README.md

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The action compiles VPP from source, optionally building a static `vppctl` binar
1414
with:
1515
MAKE_PARALLEL_JOBS: '16'
1616
BUILD_TYPE: 'release'
17+
BUILD_HST: 'false'
1718
```
1819
1920
## Inputs
@@ -22,6 +23,7 @@ The action compiles VPP from source, optionally building a static `vppctl` binar
2223
|-------|-------------|----------|---------|
2324
| `MAKE_PARALLEL_JOBS` | Number of parallel jobs for `make` to control build parallelism | No | `""` (empty, uses make's default) |
2425
| `BUILD_TYPE` | Type of build to perform: `debug` or `release` | No | `release` |
26+
| `BUILD_HST` | Build for HostStack Test (HST) framework | No | `false` |
2527
| `TUI_LINE` | Delimiter line for terminal UI output formatting | No | `*******************************************************************` |
2628

2729
## Outputs
@@ -34,19 +36,42 @@ This action does not produce explicit outputs, but it will:
3436

3537
## Build Behavior
3638

37-
### Release Build (default)
39+
The action supports two distinct build modes: **Standard VPP Build** and **HST (HostStack Test) Build**.
40+
41+
### Standard VPP Build (`BUILD_HST: "false"` - default)
42+
43+
#### Release Build (default)
3844
- Runs `make UNATTENDED=yes MAKE_PARALLEL_JOBS=<value> pkg-verify`
3945
- Builds and verifies VPP packages
4046
- Suitable for production releases and package validation
4147

42-
### Debug Build
48+
#### Debug Build
4349
- Runs `make UNATTENDED=yes MAKE_PARALLEL_JOBS=<value> build`
4450
- Builds VPP with debug symbols
4551
- Suitable for development and debugging
4652

47-
### Static vppctl
53+
#### Static vppctl
4854
If `extras/scripts/build_static_vppctl.sh` exists, it will be executed before the main build to create a statically-linked vppctl binary.
4955

56+
### HST (HostStack Test) Build (`BUILD_HST: "true"`)
57+
58+
The HST build mode is optimized for HostStack Testing framework and uses different make targets:
59+
60+
#### HST Release Build
61+
- Runs `make UNATTENDED=yes MAKE_PARALLEL_JOBS=<value> build-release`
62+
- Builds VPP optimized for HST testing
63+
- Does not include package verification step
64+
65+
#### HST Debug Build
66+
- Runs `make UNATTENDED=yes MAKE_PARALLEL_JOBS=<value> build`
67+
- Same as standard debug build but in HST context
68+
- Builds VPP with debug symbols for HST testing
69+
70+
#### HST Build Features
71+
- **No Static vppctl**: HST builds skip the static vppctl build step
72+
- **Optimized Targets**: Uses HST-specific make targets for better test performance
73+
- **Streamlined Process**: Simplified build process focused on test execution needs
74+
5075
## Prerequisites
5176

5277
Before using this action, ensure the following actions have been run:
@@ -83,6 +108,7 @@ jobs:
83108
with:
84109
MAKE_PARALLEL_JOBS: '16'
85110
BUILD_TYPE: ${{ matrix.build-type }}
111+
BUILD_HST: 'false'
86112
```
87113

88114
## Error Handling
@@ -100,12 +126,53 @@ The following environment variables are expected to be set by upstream actions:
100126
- `OS_VERSION_ID`: OS version identifier (e.g., `22.04`, `24.04`)
101127
- `OS_ARCH`: CPU architecture (e.g., `x86_64`, `aarch64`)
102128

129+
### HST-Specific Workflow
130+
131+
```yaml
132+
jobs:
133+
build-vpp-hst:
134+
runs-on: ubuntu-latest
135+
strategy:
136+
matrix:
137+
build-type: ['debug', 'release']
138+
139+
steps:
140+
- name: Checkout
141+
uses: actions/checkout@v5
142+
143+
- name: Setup Environment
144+
uses: fdio/.github/.github/actions/setup-executor-env@main
145+
146+
- name: Install VPP Dependencies
147+
uses: fdio/vpp/.github/actions/vpp-install-deps@master
148+
149+
- name: Install VPP External Dependencies
150+
uses: fdio/vpp/.github/actions/vpp-install-ext-deps@master
151+
152+
- name: Build VPP for HST
153+
uses: fdio/vpp/.github/actions/vpp-build@master
154+
with:
155+
MAKE_PARALLEL_JOBS: '16'
156+
BUILD_TYPE: ${{ matrix.build-type }}
157+
BUILD_HST: 'true'
158+
```
159+
160+
## Build Target Reference
161+
162+
| Build Mode | Build Type | Make Target | Use Case |
163+
|------------|------------|-------------|----------|
164+
| Standard | Release | `pkg-verify` | Production packages with verification |
165+
| Standard | Debug | `build` | Development and debugging |
166+
| HST | Release | `build-release` | HST framework testing |
167+
| HST | Debug | `build` | HST framework debugging |
168+
103169
## Notes
104170

105171
- The action uses `UNATTENDED=yes` to prevent interactive prompts during the build
106172
- Build output includes visual separators for improved log readability
107173
- Parallel job count can be left empty to use make's default parallelism
108-
- The action supports both Makefile targets: `build` (debug) and `pkg-verify` (release)
174+
- The action supports multiple Makefile targets based on build mode and type
175+
- HST builds are optimized for HostStack Test framework requirements
109176

110177
## Troubleshooting
111178

@@ -118,6 +185,8 @@ Verify that `setup-executor-env` action has been executed to set `OS_ID`, `OS_VE
118185
### Out of Memory Errors
119186
Reduce the `MAKE_PARALLEL_JOBS` value to decrease memory consumption during parallel compilation.
120187

121-
## License
122-
123-
This action is part of the VPP project. See the main repository LICENSE file for details.
188+
### HST Build Issues
189+
If HST builds fail:
190+
- Verify the VPP version supports HST-specific make targets (`build-release`)
191+
- Check that the build environment is properly configured for HST testing
192+
- Try switching to standard build mode (`BUILD_HST: 'false'`) to isolate HST-specific issues

.github/actions/vpp-build/action.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ inputs:
1414
required: false
1515
default: "release"
1616
type: string
17+
BUILD_HST:
18+
description: "Build VPP for HostStack Test (HST) framework"
19+
required: false
20+
default: "false"
21+
type: string
1722
TUI_LINE:
1823
description: "Delimiter line for TUI output"
1924
required: false
@@ -28,6 +33,7 @@ runs:
2833
env:
2934
MAKE_PARALLEL_JOBS: ${{ inputs.MAKE_PARALLEL_JOBS }}
3035
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
36+
BUILD_HST: ${{ inputs.BUILD_HST }}
3137
TUI_LINE: ${{ inputs.TUI_LINE }}
3238
run: |
3339
set -euo pipefail
@@ -58,8 +64,29 @@ runs:
5864
fi
5965
}
6066
67+
build_hst_vpp() {
68+
echo "Building VPP. Number of cores for build set with" \
69+
"MAKE_PARALLEL_JOBS=${MAKE_PARALLEL_JOBS}."
70+
71+
if [ "$BUILD_TYPE" == "debug" ] ; then
72+
if ! make UNATTENDED=yes MAKE_PARALLEL_JOBS=${MAKE_PARALLEL_JOBS} build ; then
73+
BUILD_ERROR="FAILED HST BUILD 'make UNATTENDED=yes MAKE_PARALLEL_JOBS=${MAKE_PARALLEL_JOBS} build'"
74+
return
75+
fi
76+
else
77+
if ! make UNATTENDED=yes MAKE_PARALLEL_JOBS=${MAKE_PARALLEL_JOBS} build-release ; then
78+
BUILD_ERROR="FAILED HST BUILD 'make UNATTENDED=yes MAKE_PARALLEL_JOBS=${MAKE_PARALLEL_JOBS} build-release'"
79+
return
80+
fi
81+
fi
82+
}
83+
6184
echo "$TUI_LINE"
62-
build_vpp
85+
if [ "$BUILD_HST" == "true" ] ; then
86+
build_hst_vpp
87+
else
88+
build_vpp
89+
fi
6390
if [ -n "${BUILD_ERROR}" ] ; then
6491
BUILD_RESULT="${BUILD_ERROR}"
6592
RETVAL="1"
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
name: "🛠️ Test VPP image using 'make test'"
3+
description: |
4+
This GitHub Action tests the VPP image built using the vpp-build action.
5+
6+
inputs:
7+
BUILD_TYPE:
8+
description: "Type of build: debug or release"
9+
required: false
10+
default: "debug"
11+
type: string
12+
HS_TEST_DIR:
13+
description: "Directory containing HostStack Test (HST) framework tests"
14+
required: false
15+
default: "${WORKSPACE}/test-c/hs-test"
16+
type: string
17+
TUI_LINE:
18+
description: "Delimiter line for TUI output"
19+
required: false
20+
default: "*******************************************************************"
21+
type: string
22+
23+
runs:
24+
using: "composite"
25+
steps:
26+
- name: VPP Make Test
27+
shell: bash
28+
env:
29+
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
30+
HS_TEST_DIR: ${{ inputs.HS_TEST_DIR }}
31+
TUI_LINE: ${{ inputs.TUI_LINE }}
32+
run: |
33+
set -euxo pipefail
34+
35+
BUILD_RESULT="SUCCESSFULLY COMPLETED"
36+
BUILD_ERROR=""
37+
RETVAL="0"
38+
39+
hst_debug_build_run() {
40+
if ! make VERBOSE=true VPPSRC="${WORKSPACE}" -C "$HST_DIR" build-debug ; then
41+
BUILD_ERROR="FAILED 'make -C $HST_DIR build-debug'"
42+
return
43+
fi
44+
if ! make VERBOSE=true VPPSRC="${WORKSPACE}" -C "$HST_DIR" test-debug ; then
45+
BUILD_ERROR="FAILED 'make -C $HST_DIR test-debug'"
46+
return
47+
fi
48+
}
49+
50+
hst_build_run() {
51+
if ! make VERBOSE=true VPPSRC="${WORKSPACE}" -C "$HST_DIR" build ; then
52+
BUILD_ERROR="FAILED 'make -C $HST_DIR build'"
53+
return
54+
fi
55+
if ! make VERBOSE=true VPPSRC="${WORKSPACE}" -C "$HST_DIR" test ; then
56+
BUILD_ERROR="FAILED 'make -C $HST_DIR test'"
57+
return
58+
fi
59+
}
60+
61+
echo "$TUI_LINE"
62+
echo "Check for system core files"
63+
ls -l /var/crash || true
64+
65+
if [ "${{ inputs.BUILD_TYPE }}" == "debug" ] ; then
66+
hst_debug_build_run
67+
else
68+
hst_build_run
69+
fi
70+
71+
echo "Check for system core files"
72+
ls -l /var/crash || true
73+
74+
if [ -n "$BUILD_ERROR" ] ; then
75+
BUILD_RESULT="$BUILD_ERROR"
76+
RETVAL="1"
77+
fi
78+
echo -e "\n$TUI_LINE\n* VPP ${BUILD_TYPE^^} ${OS_ID^^}-${OS_VERSION_ID}-${OS_ARCH^^}" \
79+
"HST $BUILD_RESULT\n$TUI_LINE\n"
80+
exit $RETVAL

.github/actions/vpp-make-test/action.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,25 @@ runs:
5656
run: |
5757
set -euxo pipefail
5858
59-
BUILD_RESULT="SUCCESSFULLY COMPLETED"
59+
BUILD_RESULT="\n* MAKE TEST SUCCESSFULLY COMPLETED"
6060
BUILD_ERROR=""
6161
RETVAL="0"
6262
6363
make_test() {
6464
if ! make UNATTENDED=yes test-dep ; then
65-
BUILD_ERROR="FAILED 'make test-dep'"
65+
BUILD_ERROR+="\n* FAILED 'make UNATTENDED=yes test-dep'"
6666
return
6767
fi
6868
if grep -q "${OS_ID}-${OS_VERSION_ID}" <<< "${VPPAPIGEN_TEST_OS}"; then
6969
if ! src/tools/vppapigen/test_vppapigen.py ; then
70-
BUILD_ERROR="FAILED src/tools/vppapigen/test_vppapigen.py"
70+
BUILD_ERROR+="\n* FAILED src/tools/vppapigen/test_vppapigen.py"
7171
return
7272
fi
7373
fi
7474
if grep -q "${OS_ID}-${OS_VERSION_ID}" <<< "${MAKE_TEST_OS}"; then
7575
if ! make COMPRESS_FAILED_TEST_LOGS=yes TEST_JOBS="$TEST_JOBS" RETRIES=3 test ; then
76-
BUILD_ERROR="FAILED 'make test'"
76+
BUILD_ERROR+="\n* FAILED 'make COMPRESS_FAILED_TEST_LOGS=yes TEST_JOBS=$TEST_JOBS "
77+
BUILD_ERROR+="RETRIES=3 test'"
7778
return
7879
fi
7980
else
@@ -82,12 +83,12 @@ runs:
8283
if grep -q "${OS_ID}-${OS_VERSION_ID}" <<< "${MAKE_TEST_MULTIWORKER_OS}"; then
8384
if ! make VPP_WORKER_COUNT="${VPP_WORKER_COUNT}" COMPRESS_FAILED_TEST_LOGS=yes \
8485
TEST_RETRIES="${TEST_RETRIES}" TEST_JOBS="${TEST_JOBS}" test ; then
85-
BUILD_ERROR="FAILED 'make VPP_WORKER_COUNT=${VPP_WORKER_COUNT} COMPRESS_FAILED_TEST_LOGS=yes \
86-
RETRIES=${TEST_RETRIES} TEST_JOBS=${TEST_JOBS} test'"
86+
BUILD_ERROR+="\n* FAILED 'make VPP_WORKER_COUNT=${VPP_WORKER_COUNT} "
87+
BUILD_ERROR+="COMPRESS_FAILED_TEST_LOGS=yes "
88+
BUILD_ERROR+="RETRIES=${TEST_RETRIES} TEST_JOBS=${TEST_JOBS} test'"
8789
return
8890
else
89-
echo -e "\n* VPP ${OS_ID^^}-${OS_VERSION_ID}-${OS_ARCH^^}" \
90-
"MULTIWORKER MAKE TEST SUCCESSFULLY COMPLETED\n"
91+
BUILD_RESULT+="\n* MULTIWORKER MAKE TEST SUCCESSFULLY COMPLETED"
9192
fi
9293
else
9394
echo "Skip running MULTIWORKER MAKE TEST on ${OS_ID}-${OS_VERSION_ID}"
@@ -100,6 +101,6 @@ runs:
100101
BUILD_RESULT="$BUILD_ERROR"
101102
RETVAL="1"
102103
fi
103-
echo -e "\n$TUI_LINE\n* VPP ${OS_ID^^}-${OS_VERSION_ID}-${OS_ARCH^^}" \
104-
"BUILD $BUILD_RESULT\n$TUI_LINE\n"
104+
echo -e "\n$TUI_LINE\n* VPP ${OS_ID^^}-${OS_VERSION_ID}-${OS_ARCH^^} BUILD " \
105+
"$BUILD_RESULT\n$TUI_LINE\n"
105106
exit $RETVAL

.github/workflows/vpp-checkstyle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ concurrency:
6767

6868
jobs:
6969
checkstyle:
70-
name: Checkstyle on ${{ matrix.os }} ${{ matrix.executor_arch }}
70+
name: vpp-checkstyle-${{ inputs.GERRIT_BRANCH }}-${{ matrix.os }}-${{ matrix.executor_arch }}
71+
if: ${{ inputs.GERRIT_EVENT_TYPE == 'patchset-created' }}
7172
runs-on:
7273
- self-hosted
7374
- nomad

0 commit comments

Comments
 (0)