allow runtime config in int-test of bytecode images #2
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
name: basic-integration-tests | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [main] | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
basic-integration-tests: | ||
runs-on: ubuntu-latest | ||
needs: [build, bpfman-image-build] | ||
env: | ||
XDP_PASS_IMAGE_LOC: quay.io/bpfman-bytecode/xdp_pass:${GITHUB_REF_NAME} | ||
TC_PASS_IMAGE_LOC: quay.io/bpfman-bytecode/tc_pass:${GITHUB_REF_NAME} | ||
TRACEPOINT_IMAGE_LOC: quay.io/bpfman-bytecode/tracepoint:${GITHUB_REF_NAME} | ||
UPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/uprobe:${GITHUB_REF_NAME} | ||
URETPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/uretprobe:${GITHUB_REF_NAME} | ||
KPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/kprobe:${GITHUB_REF_NAME} | ||
KRETPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/kretprobe:${GITHUB_REF_NAME} | ||
XDP_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-xdp-counter:${GITHUB_REF_NAME} | ||
TC_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-tc-counter:${GITHUB_REF_NAME} | ||
TRACEPOINT_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-tracepoint-counter:${GITHUB_REF_NAME} | ||
FENTRY_IMAGE_LOC: quay.io/bpfman-bytecode/fentry:${GITHUB_REF_NAME} | ||
FEXIT_IMAGE_LOC: quay.io/bpfman-bytecode/fexit:${GITHUB_REF_NAME} | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: network=host | ||
- name: Checkout bpfman | ||
uses: actions/checkout@v4 | ||
- name: Download bpfman x86_64 build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bpfman-debug-linux-x86_64 | ||
merge-multiple: true | ||
- name: Unpack binaries | ||
run: | | ||
mkdir -p target/debug | ||
tar -C target/debug -xzvf bpfman-debug-linux-x86_64.tar.gz | ||
- name: Download Integration Test eBPF | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bpfman-integration-test | ||
merge-multiple: true | ||
- name: Unpack Integration Test eBPF | ||
run: | | ||
tar -xzvf integration-test.tar.gz | ||
- name: Download manpages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bpfman-manpages | ||
merge-multiple: true | ||
- name: Unpack manpages | ||
run: | | ||
tar -xzvf manpages.tar.gz | ||
- name: Download CLI TAB Completion | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bpfman-cli-tab-completion | ||
merge-multiple: true | ||
- name: Unpack CLI TAB Completion | ||
run: | | ||
tar -xzvf cli-tab-completion.tar.gz | ||
- name: Install libelf-dev | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y linux-headers-`uname -r` clang lldb lld libelf-dev gcc-multilib libbpf-dev | ||
- name: Generate go wrapped eBPF | ||
run: | | ||
cd examples && make generate | ||
- name: build and push bytecode images to local registry | ||
run: | | ||
- name: Run the bpfman installer | ||
run: sudo ./scripts/setup.sh install | ||
- name: Verify the bpfman systemd service is active | ||
run: systemctl is-active bpfman.socket | ||
- name: Verify the CLI can reach bpfman | ||
run: sudo bpfman list | ||
- name: Verify the manpages are installed | ||
run: man bpfman list | ||
- name: Stop the bpfman systemd service | ||
run: | | ||
sudo systemctl stop bpfman | ||
sudo ./scripts/setup.sh uninstall | ||
- name: Run integration tests | ||
run: cargo xtask integration-test | ||
coverage: | ||
needs: [build, build-go] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download rust coverage artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage-rust | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./lcov.info | ||
verbose: true | ||
# Creates Release | ||
# Copies built bpfman binaries to release artifacts | ||
# Publish's bpfman and bpfman-api crates to crates.io | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [build] | ||
environment: crates.io | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout bpfman | ||
uses: actions/checkout@v4 | ||
- name: Set env | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
if [[ ${GITHUB_REF#refs/*/} =~ "rc" ]]; then | ||
echo "PRE_RELEASE=true" >> $GITHUB_ENV | ||
else | ||
echo "PRE_RELEASE=false" >> $GITHUB_ENV | ||
fi | ||
- name: Download bpfman Release Binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: bpfman-release-* | ||
merge-multiple: true | ||
- name: release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: ./changelogs/CHANGELOG-${{ env.RELEASE_VERSION }}.md | ||
prerelease: ${{ env.PRE_RELEASE }} | ||
files: | | ||
bpfman-linux-x86_64.tar.gz | ||
- name: publish bpfman crate | ||
run: cargo publish -p bpfman --token ${{ secrets.BPFMAN_DEV_TOKEN }} | ||
- name: publish bpfman-api crate | ||
run: cargo publish -p bpfman-api --token ${{ secrets.BPFMAN_DEV_TOKEN }} | ||
- name: publish bpf-log-exporter crate | ||
run: cargo publish -p bpf-log-exporter --token ${{ secrets.BPFMAN_DEV_TOKEN }} | ||
- name: publish bpf-metrics-exporter crate | ||
run: cargo publish -p bpf-metrics-exporter --token ${{ secrets.BPFMAN_DEV_TOKEN }} | ||
build-workflow-complete: | ||
needs: | ||
[ | ||
check-license, | ||
build, | ||
build-go, | ||
build-docs, | ||
coverage, | ||
basic-integration-tests, | ||
] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Complete | ||
run: echo "Build Complete" |