0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

CI/CD: code coverage and bazel improvements

This commit is contained in:
Ramkumar Chinchani 2019-06-26 14:31:43 -07:00
parent 29e955e22b
commit c142daff87
4 changed files with 16 additions and 4 deletions

View file

@ -13,8 +13,16 @@ matrix:
notifications: notifications:
email: false email: false
cache:
directories:
- $HOME/.bzrepos
- $HOME/.cache/bazel
install: install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -N https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-installer-linux-x86_64.sh && chmod +x bazel-0.26.1-installer-linux-x86_64.sh && ./bazel-0.26.1-installer-linux-x86_64.sh --user; go get -u github.com/swaggo/swag/cmd/swag; go mod download; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -N https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-installer-linux-x86_64.sh && chmod +x bazel-0.26.1-installer-linux-x86_64.sh && ./bazel-0.26.1-installer-linux-x86_64.sh --user; go get -u github.com/swaggo/swag/cmd/swag; go mod download; fi
script: script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make && make -f Makefile.bazel build; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make && make -f Makefile.bazel build; fi
after_success:
- bash <(curl -s https://codecov.io/bash)

View file

@ -13,7 +13,7 @@ debug: doc
.PHONY: test .PHONY: test
test: test:
go test -v -race -cover ./pkg/... ./cmd/... go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./...
./bin/golangci-lint: ./bin/golangci-lint:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1 curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1

View file

@ -1,6 +1,10 @@
OS := $(shell uname -s | tr A-Z a-z) OS := $(shell uname -s | tr A-Z a-z)
BINARY_PREFIX_DIRECTORY := $(OS)_amd64_stripped BINARY_PREFIX_DIRECTORY := $(OS)_amd64_stripped
BAZEL=$(HOME)/bin/bazel BAZEL=$(HOME)/bin/bazel
BAZELOPTS= --repository_cache="$$HOME/.bzrepos" \
--test_output=errors \
--noshow_progress \
--noshow_loading_progress
.PHONY: all .PHONY: all
all: build check all: build check
@ -31,8 +35,8 @@ init: setup-base update-bazel fmt-bazel
.PHONY: build .PHONY: build
build: build:
${BAZEL} build //... ${BAZEL} build ${BAZELOPTS} //...
${BAZEL} test //... ${BAZEL} test ${BAZELOPTS} //...
.PHONY: check .PHONY: check
check: check:

View file

@ -1,4 +1,4 @@
# zot [![Build Status](https://travis-ci.org/anuvu/zot.svg?branch=master)](https://travis-ci.org/anuvu/zot) # zot [![Build Status](https://travis-ci.org/anuvu/zot.svg?branch=master)](https://travis-ci.org/anuvu/zot) [![codecov.io](http://codecov.io/github/anuvu/zot/coverage.svg?branch=master)](http://codecov.io/github/anuvu/zot?branch=master)
**zot** is a single-purpose OCI image repository server based on the **zot** is a single-purpose OCI image repository server based on the
[OCI distribution spec](https://github.com/opencontainers/distribution-spec). [OCI distribution spec](https://github.com/opencontainers/distribution-spec).