Skip to content

Commit

Permalink
ci: use codecov (#12)
Browse files Browse the repository at this point in the history
* ci: use codecov

* update

* update

* update

* update

* fix

* update

* fix path

* remove diff

* fix test

* update
  • Loading branch information
yunwei37 authored Aug 29, 2024
1 parent 997d022 commit f6a726c
Show file tree
Hide file tree
Showing 7 changed files with 495 additions and 59 deletions.
414 changes: 414 additions & 0 deletions .github/assets/bpf_conformance_test.txt

Large diffs are not rendered by default.

64 changes: 37 additions & 27 deletions .github/workflows/bpf_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,61 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- ubuntu-2204
container:
image: "manjusakalza/bpftime-base-image:${{matrix.container}}"
options: --privileged
steps:

- name: cache dependencies
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/${{ env.INSTALL_LOCATION }}
key: ${{ runner.os }}-dependencies

- uses: actions/checkout@v2
with:
submodules: 'recursive'

- uses: actions/setup-python@v4
if: startsWith(matrix.container,'ubuntu')
with:
python-version: '3.8'

- name: Install lcov (Ubuntu)
run: sudo apt install -y lcov llvm-15-dev libzstd-dev libboost-all-dev

- name: build
run:
|
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1
LLVM_DIR=/usr/lib/llvm-15/cmake cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBPFTIME_ENABLE_CODE_COVERAGE=1
cmake --build build --target all -j

- name: get bpf_conformance
- name: get bpf_conformance for spec version
run: |
git clone https://github.com/Alan-Jowett/bpf_conformance --recursive
cd bpf_conformance
git checkout 89c3d74
cmake . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target bpf_conformance_runner
- name: test bpf_conformance
run: |
cd bpf_conformance
./build/bin/bpf_conformance_runner --test_file_directory \
tests --plugin_path \
../build/test/bpf_conformance_runner/bpftime_vm_bpf_conformance_runner \
> ../bpf_conformance_results.txt || echo "ok"
./bpf_conformance/build/bin/bpf_conformance_runner --cpu_version v3 --exclude_regex "lock_xchg+|le+" --test_file_directory \
./bpf_conformance/tests --plugin_path \
build/test/bpf_conformance_runner/bpftime_vm_bpf_conformance_runner
- name: upload coverage
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage.info # optional
flags: bpf_conformance
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

- name: get bpf_conformance newest
run: |
cd bpf_conformance
git checkout main
cmake . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target bpf_conformance_runner
- name: test bpf_conformance newest
run: |
./bpf_conformance/build/bin/bpf_conformance_runner --test_file_directory \
./bpf_conformance/tests --plugin_path \
build/test/bpf_conformance_runner/bpftime_vm_bpf_conformance_runner \
> bpf_conformance_results.txt || echo "ok"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-aot-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run:
dnf install -y ninja-build


- name: Build and install everything
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBUILD_LLVM_AOT_CLI=1 -G Ninja
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-vm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test VM input and output
name: Build and Test VM

on:
push:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
with:
python-version: '3.8'

- name: build
- name: build debug
run:
|
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -G Ninja
Expand All @@ -62,3 +62,8 @@ jobs:
pip install -r test/requirements.txt
# make build # or build-arm32 build-arm64
pytest -v -s test/test_framework
- name: build llvm JIT/AOT release as a standalone library
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja &&\
cmake --build build --target all -j
47 changes: 18 additions & 29 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,21 @@ on:
branches: "main"
pull_request:
branches: "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
container:
- ubuntu-2204
- fedora-39
runs-on: ubuntu-22.04
container:
image: "manjusakalza/bpftime-base-image:${{matrix.container}}"
options: --privileged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Install Ninja (Ubuntu)
if: ${{matrix.container == 'ubuntu-2204'}}
run:
apt install ninja-build

- name: Install Ninja (Fedora)
if: ${{matrix.container == 'fedora-39'}}
run:
dnf install -y ninja-build


- name: Install Ninja and lcov (Ubuntu)
run: sudo apt install -y ninja-build lcov llvm-15-dev libzstd-dev

- name: build
run:
run:
|
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -G Ninja
LLVM_DIR=/usr/lib/llvm-15/cmake cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBPFTIME_ENABLE_CODE_COVERAGE=1 -G Ninja
cmake --build build --target all -j

- name: Run example
Expand All @@ -49,8 +30,16 @@ jobs:
run: |
./build/test/unit-test/llvm_jit_tests
- name: build llvm JIT/AOT release as a standalone library
- name: upload coverage
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja &&\
cmake --build build --target all -j
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage.info # optional
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Userspace eBPF VM with LLVM JIT/AOT Compiler

[![Build and Test VM](https://github.com/eunomia-bpf/llvmbpf/actions/workflows/test-vm.yml/badge.svg)](https://github.com/eunomia-bpf/llvmbpf/actions/workflows/test-vm.yml)
[![codecov](https://codecov.io/gh/eunomia-bpf/llvmbpf/graph/badge.svg?token=ZQXHpOwDa1)](https://codecov.io/gh/eunomia-bpf/llvmbpf)

A high-performance, multi-architecture JIT/AOT compiler and virtual machine (VM) based on LLVM.

Expand Down
17 changes: 17 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ignore:
- "build"

coverage:
status:
project:
default:
target: auto
# adjust accordingly based on how flaky your tests are
# this allows a 0.5% drop from the previous base commit coverage
threshold: 0.5%

patch:
default:
target: auto
base: auto
only_pulls: false

0 comments on commit f6a726c

Please sign in to comment.