mirror of
https://github.com/Telecominfraproject/wlan-cloud-kube-state-metrics.git
synced 2025-11-01 11:07:50 +00:00
use github actions for CI checks
This commit is contained in:
64
.github/workflows/ci.yml
vendored
Normal file
64
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
E2E_SETUP_KIND: yes
|
||||||
|
E2E_SETUP_KUBECTL: yes
|
||||||
|
SUDO: sudo
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set up Go 1.x
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ^1.14
|
||||||
|
id: go
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install CI
|
||||||
|
run: |
|
||||||
|
go get -v -t -d ./...
|
||||||
|
make install-tools
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: |
|
||||||
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
|
||||||
|
make lint
|
||||||
|
|
||||||
|
- name: Validate generated manifests
|
||||||
|
run: |
|
||||||
|
make validate-manifests
|
||||||
|
|
||||||
|
- name: Validate vendor is in sync with go modules
|
||||||
|
run: |
|
||||||
|
make validate-modules
|
||||||
|
|
||||||
|
- name: Check that all metrics are documented
|
||||||
|
run: |
|
||||||
|
make doccheck
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: |
|
||||||
|
make test-unit
|
||||||
|
|
||||||
|
- name: Benchmark tests
|
||||||
|
run: |
|
||||||
|
make test-benchmark-compare
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
|
||||||
|
- name: End-to-end tests
|
||||||
|
run: |
|
||||||
|
REGISTRY="quay.io/coreos" make e2e
|
||||||
51
.travis.yml
51
.travis.yml
@@ -1,51 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
dist: xenial
|
|
||||||
language: go
|
|
||||||
|
|
||||||
go:
|
|
||||||
- "1.14.x"
|
|
||||||
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
git:
|
|
||||||
# Benchmark tests needs to access other branches, thereby we need to fetch all
|
|
||||||
# of the repository.
|
|
||||||
depth: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- E2E_SETUP_KIND=yes
|
|
||||||
- E2E_SETUP_KUBECTL=yes
|
|
||||||
- SUDO=sudo
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- make install-tools
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- sudo apt-get -qq -y install conntrack
|
|
||||||
|
|
||||||
install:
|
|
||||||
- mkdir -p $HOME/gopath/src/k8s.io
|
|
||||||
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics
|
|
||||||
- cd $HOME/gopath/src/k8s.io/kube-state-metrics
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- stage: all
|
|
||||||
name: Lint
|
|
||||||
script: make lint
|
|
||||||
- name: Validate generated manifests
|
|
||||||
script: make validate-manifests
|
|
||||||
- name: Validate vendor is in sync with go modules
|
|
||||||
script: make validate-modules
|
|
||||||
- name: Check that all metrics are documented
|
|
||||||
script: make doccheck
|
|
||||||
- name: Unit tests
|
|
||||||
script: make test-unit
|
|
||||||
- name: Benchmark tests
|
|
||||||
script: make test-benchmark-compare
|
|
||||||
- name: Build
|
|
||||||
script: make build
|
|
||||||
- name: End to end tests
|
|
||||||
script: REGISTRY="quay.io/coreos" make e2e
|
|
||||||
13
Makefile
13
Makefile
@@ -13,11 +13,6 @@ Commit = $(shell git rev-parse --short HEAD)
|
|||||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||||
PKG = k8s.io/kube-state-metrics/pkg
|
PKG = k8s.io/kube-state-metrics/pkg
|
||||||
GO_VERSION = 1.14.7
|
GO_VERSION = 1.14.7
|
||||||
FIRST_GOPATH := $(firstword $(subst :, ,$(shell go env GOPATH)))
|
|
||||||
BENCHCMP_BINARY := $(FIRST_GOPATH)/bin/benchcmp
|
|
||||||
GOLANGCI_VERSION := v1.29.0
|
|
||||||
HAS_GOLANGCI := $(shell command -v golangci-lint)
|
|
||||||
|
|
||||||
IMAGE = $(REGISTRY)/kube-state-metrics
|
IMAGE = $(REGISTRY)/kube-state-metrics
|
||||||
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
|
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
|
||||||
|
|
||||||
@@ -43,9 +38,6 @@ licensecheck:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
lint: shellcheck licensecheck
|
lint: shellcheck licensecheck
|
||||||
ifndef HAS_GOLANGCI
|
|
||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin ${GOLANGCI_VERSION}
|
|
||||||
endif
|
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
|
|
||||||
doccheck: generate
|
doccheck: generate
|
||||||
@@ -77,7 +69,8 @@ shellcheck:
|
|||||||
|
|
||||||
# Runs benchmark tests on the current git ref and the last release and compares
|
# Runs benchmark tests on the current git ref and the last release and compares
|
||||||
# the two.
|
# the two.
|
||||||
test-benchmark-compare: $(BENCHCMP_BINARY)
|
test-benchmark-compare:
|
||||||
|
@git fetch
|
||||||
./tests/compare_benchmarks.sh master
|
./tests/compare_benchmarks.sh master
|
||||||
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH}
|
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH}
|
||||||
|
|
||||||
@@ -128,7 +121,7 @@ e2e:
|
|||||||
generate: build-local
|
generate: build-local
|
||||||
@echo ">> generating docs"
|
@echo ">> generating docs"
|
||||||
@./scripts/generate-help-text.sh
|
@./scripts/generate-help-text.sh
|
||||||
@$(GOPATH)/bin/embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`
|
embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`
|
||||||
|
|
||||||
validate-manifests: examples
|
validate-manifests: examples
|
||||||
@git diff --exit-code
|
@git diff --exit-code
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
[](https://travis-ci.org/kubernetes/kube-state-metrics) [](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics) [](https://godoc.org/github.com/kubernetes/kube-state-metrics)
|
[](https://github.com/kubernetes/kube-state-metrics/actions)
|
||||||
|
[](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics) [](https://godoc.org/github.com/kubernetes/kube-state-metrics)
|
||||||
|
|
||||||
kube-state-metrics is a simple service that listens to the Kubernetes API
|
kube-state-metrics is a simple service that listens to the Kubernetes API
|
||||||
server and generates metrics about the state of the objects. (See examples in
|
server and generates metrics about the state of the objects. (See examples in
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ This folder contains simple e2e tests.
|
|||||||
When launched, it spins up a kubernetes cluster using [kind](https://kind.sigs.k8s.io/), creates several kubernetes resources and launches a kube-state-metrics deployment.
|
When launched, it spins up a kubernetes cluster using [kind](https://kind.sigs.k8s.io/), creates several kubernetes resources and launches a kube-state-metrics deployment.
|
||||||
Then, it runs verification tests: check metrics' presence, lint metrics, check service health, etc.
|
Then, it runs verification tests: check metrics' presence, lint metrics, check service health, etc.
|
||||||
|
|
||||||
The test suite is run automatically using Travis.
|
The test suite is run automatically using Github Actions.
|
||||||
|
|
||||||
## Running locally
|
## Running locally
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user