Skip to content

Commit

Permalink
use github actions for CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tariq1890 committed Aug 4, 2020
1 parent 93b5336 commit dafabf6
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 63 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Go

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 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ Commit = $(shell git rev-parse --short HEAD)
ALL_ARCH = amd64 arm arm64 ppc64le s390x
PKG = k8s.io/kube-state-metrics/pkg
GO_VERSION = 1.14.6
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
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)

Expand All @@ -43,9 +38,6 @@ licensecheck:
fi

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

doccheck: generate
Expand Down Expand Up @@ -77,7 +69,8 @@ shellcheck:

# Runs benchmark tests on the current git ref and the last release and compares
# the two.
test-benchmark-compare: $(BENCHCMP_BINARY)
test-benchmark-compare:
@git fetch
./tests/compare_benchmarks.sh master
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH}

Expand Down Expand Up @@ -128,7 +121,7 @@ e2e:
generate: build-local
@echo ">> generating docs"
@./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
@git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

[![Build Status](https://travis-ci.org/kubernetes/kube-state-metrics.svg?branch=master)](https://travis-ci.org/kubernetes/kube-state-metrics) [![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics)](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics) [![GoDoc](https://godoc.org/github.com/kubernetes/kube-state-metrics?status.svg)](https://godoc.org/github.com/kubernetes/kube-state-metrics)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics)](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics) [![GoDoc](https://godoc.org/github.com/kubernetes/kube-state-metrics?status.svg)](https://godoc.org/github.com/kubernetes/kube-state-metrics)

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
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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

Expand Down

0 comments on commit dafabf6

Please sign in to comment.