ON-15945: Add option to build RPM from system installed onload #56
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
# SPDX-License-Identifier: BSD-2-Clause | |
# X-SPDX-Copyright-Text: (c) Copyright 2024 Advanced Micro Devices, Inc. | |
name: "perform_build" | |
on: | |
push: | |
pull_request: | |
types: [opened] | |
jobs: | |
extract_branch_info: | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
outputs: | |
tcpdirectBranch: ${{ steps.tcpdirectBranch.outputs.branch }} | |
onloadBranch: ${{ steps.onloadBranch.outputs.branch }} | |
onloadReleaseTag: ${{ steps.onloadReleaseTag.outputs.tag }} | |
packetDrillBranch: ${{ steps.packetDrillBranch.outputs.branch }} | |
steps: | |
- name: tcpdirect | |
uses: actions/checkout@v4 | |
with: | |
path: tcpdirect | |
- name: Install yq | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3 python3-pip jq | |
pip3 install yq | |
- name: Extract TCPDirect branch name | |
id: tcpdirectBranch | |
run: echo "branch=$(yq -r '.products.TCPDirect.version' < $GITHUB_WORKSPACE/tcpdirect/versions.yaml)" >> "$GITHUB_OUTPUT" | |
- name: Extract onload branch name | |
id: onloadBranch | |
run: echo "branch=$(yq -r '.products.Onload.version' < $GITHUB_WORKSPACE/tcpdirect/versions.yaml)" >> "$GITHUB_OUTPUT" | |
- name: Extract onload release tag | |
id: onloadReleaseTag | |
run: echo "tag=$(yq -r '.products.Onload.release_tag' < $GITHUB_WORKSPACE/tcpdirect/versions.yaml)" >> "$GITHUB_OUTPUT" | |
- name: Extract packetDrill branch name | |
id: packetDrillBranch | |
run: echo "branch=$(yq -r '.products.Packetdrill.version' < $GITHUB_WORKSPACE/tcpdirect/versions.yaml)" >> "$GITHUB_OUTPUT" | |
perform_build_and_test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
needs: extract_branch_info | |
steps: | |
- name: tcpdirect | |
uses: actions/checkout@v4 | |
with: | |
path: tcpdirect | |
- name: onload checkout | |
id: onloadCheckoutStep | |
continue-on-error: true | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/onload | |
path: onload | |
ref: ${{ needs.extract_branch_info.outputs.onloadBranch }} | |
- name: onload checkout tag | |
if: ${{ steps.onloadCheckoutStep.outcome == 'failure' && | |
needs.extract_branch_info.output.onloadReleaseTag != 'null' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.repository_owner }}/onload | |
path: onload | |
ref: ${{ needs.extract_branch_info.outputs.onloadReleaseTag }} | |
- name: packetdrill checkout | |
uses: actions/checkout@v4 | |
continue-on-error: true | |
with: | |
repository: ${{ github.repository_owner }}/packetdrill-tcpdirect | |
path: packetdrill-tcpdirect | |
ssh-key: ${{ secrets.PACKET_DRILL_PRIVATE_KEY }} | |
ref: ${{ needs.extract_branch_info.outputs.packetDrillBranch }} | |
- name: Install TCPDirect Deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential perl | |
- name: build | |
run: | | |
cd $GITHUB_WORKSPACE/tcpdirect | |
ONLOAD_TREE=$GITHUB_WORKSPACE/onload NDEBUG=1 make -j $(nproc) | |
- name: shim | |
run: | | |
cd $GITHUB_WORKSPACE/tcpdirect | |
ONLOAD_TREE=$GITHUB_WORKSPACE/onload NDEBUG=1 ZF_DEVEL=1 TEST_THREAD_NAME=zf make -j $(nproc) shim | |
- name: tests | |
run: | | |
cd $GITHUB_WORKSPACE/tcpdirect | |
ONLOAD_TREE=$GITHUB_WORKSPACE/onload UT_OUTPUT=$GITHUB_STEP_SUMMARY NDEBUG=1 ZF_DEVEL=1 TEST_THREAD_NAME=zf make -j $(nproc) -k test |