Skip to content

Commit

Permalink
Merge pull request #177 from daemon1024/go-workflow
Browse files Browse the repository at this point in the history
Create Go Related Workflows in Github Actions
  • Loading branch information
nam-jaehyun authored Jul 4, 2021
2 parents 26d3241 + 12eb34b commit e4d1046
Showing 1 changed file with 62 additions and 0 deletions.
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

0 comments on commit e4d1046

Please # to comment.