Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create Go Related Workflows in Github Actions #177

Merged
merged 1 commit into from
Jul 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
@@ -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