From 3fabe5c9bf8ed722f1ba9a91c006bb4c02ff2c95 Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Thu, 8 Jul 2021 17:25:23 +0530 Subject: [PATCH] update ci --- .github/workflows/go-action.yml | 85 -------------------------------- .github/workflows/go-vagrant.yml | 13 +++-- 2 files changed, 10 insertions(+), 88 deletions(-) delete mode 100644 .github/workflows/go-action.yml diff --git a/.github/workflows/go-action.yml b/.github/workflows/go-action.yml deleted file mode 100644 index f15dd6c06c..0000000000 --- a/.github/workflows/go-action.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: ci - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - name: go build lint test checks - 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: Print system info - run: | - cat /etc/os-release - uname -a - - - name: build - run: cd KubeArmor && make build - env: - GOPATH: /home/runner/go - - - name: test - run: cd KubeArmor && make testall - - - name: Coverage Feeder - run: | - go mod tidy - go test -race -covermode=atomic - working-directory: KubeArmor/feeder - - - name: Coverage Enforcer - run: | - go mod tidy - go test -race -covermode=atomic - working-directory: KubeArmor/enforcer - - - name: Coverage Monitor - run: | - go mod tidy - go test -race -covermode=atomic - working-directory: KubeArmor/monitor - - - name: Clean modcache - run: go clean -modcache - - - name: Lint - uses: golangci/golangci-lint-action@v2 - with: - working-directory: KubeArmor diff --git a/.github/workflows/go-vagrant.yml b/.github/workflows/go-vagrant.yml index 0d9bd082b8..5030d72a51 100644 --- a/.github/workflows/go-vagrant.yml +++ b/.github/workflows/go-vagrant.yml @@ -27,9 +27,16 @@ jobs: run: ssh-keygen -f $HOME/.ssh/id_rsa.pub -q -N "" - name: Run vagrant up - run: VAGRANT_LOG=info vagrant up + run: vagrant up working-directory: contribution/vagrant - - name: Build & Test - run: vagrant ssh -c "export GOPATH=\$HOME/go;export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin;export KUBECONFIG=\$HOME/.kube/config;cd KubeArmor/KubeArmor;make clean;make;cd ..;cd tests;nohup kubectl proxy & sleep 1;cat nohup.out;./test-scenarios-local.sh;cat /tmp/kubearmor.test" + - name: Build + run: vagrant ssh -c "export GOPATH=\$HOME/go;export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin;export KUBECONFIG=\$HOME/.kube/config;cd KubeArmor/KubeArmor;make clean;make;" working-directory: contribution/vagrant + + - name: Test + run: | + bash -c 'vagrant ssh -c "nohup kubectl proxy & sleep 1;curl 127.0.0.1:8001"' &> /dev/null + vagrant ssh -c "export GOPATH=\$HOME/go;export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin;export KUBECONFIG=\$HOME/.kube/config;cd KubeArmor/tests;./test-scenarios-local.sh" + working-directory: contribution/vagrant + shell: bash