From 12eb34b2187f8c44132bfb0c54859c5d56e4b556 Mon Sep 17 00:00:00 2001 From: Barun Acharya <47106543+daemon1024@users.noreply.github.com> Date: Thu, 1 Jul 2021 13:23:20 +0530 Subject: [PATCH] Create Go Related Workflows in Github Actions --- .github/workflows/ci-go.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci-go.yml diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml new file mode 100644 index 0000000000..b580d16806 --- /dev/null +++ b/.github/workflows/ci-go.yml @@ -0,0 +1,62 @@ +name: ci + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: go workflows + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Check module vendoring + run: | + cd KubeArmor + go mod tidy + test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy && go mod vendor', and submit your changes"; exit 1) + + - name: Build bcc + run: | + set -x + sudo apt-get update + # Use release 9 of llvm etc. - later versions have an unfixed + # bug on Ubuntu: + # https://github.com/iovisor/bcc/issues/2915 + sudo apt-get -y install bison build-essential cmake flex git libelf-dev libfl-dev libedit-dev libllvm9 llvm-9-dev libclang-9-dev python zlib1g-dev + pushd /tmp + git clone --depth 1 --branch v0.20.0 https://github.com/iovisor/bcc.git + mkdir -p bcc/build; cd bcc/build + # Symlink /usr/lib/llvm to avoid "Unable to find clang libraries" + # The directory appears only to be created when installing the + # virtual llvm-dev package. + # https://github.com/iovisor/bcc/issues/492 + sudo ln -s /usr/lib/llvm-9 /usr/local/llvm + cmake .. + make + sudo make install + popd + + - name: build + run: cd KubeArmor && make build + env: + GOPATH: /home/runner/go + + - name: test + run: cd KubeArmor && make testall + + - name: Clean modcache + run: go clean -modcache + + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + working-directory: KubeArmor