diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index a36477fa0d..b4689a5480 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -27,17 +27,26 @@ jobs: env: GOPATH: /home/runner/go GOBIN: /home/runner/go/bin - - name: install libbpf - uses: sustainable-computing-io/kepler-action@v0.0.4 - with: - ebpfprovider: libbpf - name: Prepare environment run: | - sudo apt-get install -y cpuid + sudo apt-get install -y cpuid clang cd doc/ && sudo ./dev/prepare_dev_env.sh && cd - git config --global --add safe.directory /kepler + - name: install libbpf + uses: sustainable-computing-io/kepler-action@v0.0.3 + with: + ebpfprovider: libbpf - name: Run run: | + sudo apt remove libbpf-dev + mkdir temp-libbpf + cd temp-libbpf + git clone https://github.com/libbpf/libbpf + cd libbpf/src + sudo make install_headers + sudo make install_uapi_headers + sudo prefix=/usr BUILD_STATIC_ONLY=y make install + cd ../../../ ATTACHER_TAG=libbpf make test-verbose go tool cover -func=coverage.out -o=coverage.out - name: Go Coverage Badge # Pass the `coverage.out` output to this action diff --git a/.golangci.yml b/.golangci.yml index a5f791c0b9..59b42409a0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -94,4 +94,4 @@ issues: text: "could not import C" - linters: - dupl - text: ".*pkg/collector/metric/types/types_test.go.*" # false positive, https://github.com/mibk/dupl/issues/20 \ No newline at end of file + text: ".*pkg/collector/stats/types/types_test.go.*" # false positive, https://github.com/mibk/dupl/issues/20 \ No newline at end of file diff --git a/Makefile b/Makefile index c54cf5b18a..0c200d808d 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ export TIMESTAMP ?=$(shell echo $(BIN_TIMESTAMP) | tr -d ':' | tr 'T' '-' | tr - # restrict included verify-* targets to only process project files SOURCE_GIT_TAG := $(shell git describe --tags --always --abbrev=7 --match 'v*') SRC_ROOT := $(shell pwd) +ARCH := $(shell arch) OUTPUT_DIR := _output CROSS_BUILD_BINDIR := $(OUTPUT_DIR)/bin GIT_VERSION := $(shell git describe --dirty --tags --always --match='v*') diff --git a/README.md b/README.md index f139ac192b..ce56f2220e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ![GitHub Workflow Status (event)](https://img.shields.io/github/actions/workflow/status/sustainable-computing-io/kepler/unit_test.yml?branch=main&label=CI) + ![Coverage](https://img.shields.io/badge/Coverage-42.1%25-yellow) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7391/badge)](https://bestpractices.coreinfrastructure.org/projects/7391)