refactor(sysadvisor): bind reclaim_cores contianers to non-exclusive … #1445
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: {} | |
workflow_dispatch: {} | |
jobs: | |
fmt: | |
name: Format | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Check Go modules | |
run: | | |
go mod tidy && git add go.* && | |
git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1); | |
- name: Verify gofmt | |
run: | | |
make fmt && git add pkg cmd && | |
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1); | |
vet: | |
name: Vet | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: Verify govet | |
run: | | |
make vet && git add pkg cmd && | |
git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1); | |
lint: | |
name: Lint | |
runs-on: vci-self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- uses: golangci/golangci-lint-action@v3 | |
with: | |
args: --verbose --out-${NO_FUTURE}format colored-line-number --config .golangci.yml | |
version: v1.52.2 | |
skip-cache: true | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
- name: Build | |
run: make all-binaries | |
unit-test: | |
name: Unit Test | |
runs-on: vke-self-hosted | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
- name: Coverage | |
run: sudo make test | |
- name: Check the number of changed lines | |
run: | | |
LINES_ADDED=$(git diff --numstat ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} pkg/ | awk '{ add += $1 } END { printf add }') | |
echo "lines added: $LINES_ADDED" | |
if [[ $LINES_ADDED -lt 10 ]]; then | |
echo "NEED_TO_CHECK=false" >> $GITHUB_ENV | |
else | |
echo "NEED_TO_CHECK=true" >> $GITHUB_ENV | |
fi | |
- name: Upload coverage to Codecov | |
if: ${{ (env.NEED_TO_CHECK == 'true') || (github.event_name != 'pull_request') }} | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: unittest | |
file: coverage.txt | |
fail_ci_if_error: true | |
verbose: true | |
license: | |
name: License | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check license header | |
run: | | |
make license && git add pkg cmd && | |
git diff --cached --exit-code || (echo 'Please run "make license" to add license headers' && exit 1); |