-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from daemon1024/go-workflow
Create Go Related Workflows in Github Actions
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |