diff --git a/.github/workflows/go-c-cpp.yml b/.github/workflows/go-c-cpp.yml index de6c054144..18c3849cf5 100644 --- a/.github/workflows/go-c-cpp.yml +++ b/.github/workflows/go-c-cpp.yml @@ -17,7 +17,7 @@ jobs: - name: Install Compilers run: | sudo apt-get update - sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic + sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic gcc for tool in "clang" "llc" "llvm-strip" do sudo rm -f /usr/bin/$tool @@ -28,35 +28,18 @@ jobs: with: submodules: 'recursive' fetch-depth: 0 - - name: Build + - name: Build && golangci-lint run: | make clean make env make nocore -j4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - # version: v3.2.0 - - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - args: --disable-all -E errcheck - - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the all caching functionality will be complete disabled, - # takes precedence over all other caching options. - skip-cache: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - skip-build-cache: true + CGO_CFLAGS = "-O2 -g -gdwarf-4 -I$GITHUB_WORKSPACE/lib/libpcap/" + CGO_LDFLAGS = "-O2 -g -L$GITHUB_WORKSPACE/lib/libpcap -lpcap -static" + echo $CGO_CFLAGS + echo $CGO_LDFLAGS + echo $CC + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2 + $(go env GOPATH)/bin/golangci-lint run --disable-all -E errcheck - name: Build NOCORE run: | make clean @@ -75,7 +58,7 @@ jobs: - name: Install Compilers run: | sudo apt-get update - sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-common linux-tools-generic + sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-common linux-tools-generic gcc for tool in "clang" "llc" "llvm-strip" do sudo rm -f /usr/bin/$tool @@ -93,6 +76,10 @@ jobs: make -j8 - name: golangci-lint uses: golangci/golangci-lint-action@v4 + env: + CGO_CFLAGS: -O2 -g -gdwarf-4 -I$GITHUB_WORKSPACE/lib/libpcap/ + CGO_LDFLAGS: -O2 -g -L$GITHUB_WORKSPACE/lib/libpcap/ -lpcap -static + CC: /usr/bin/clang with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version # version: v3.2.0