2021-07-01 14:16:33 +00:00
|
|
|
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
default:
|
|
|
|
image: docker:stable
|
|
|
|
services:
|
|
|
|
- name: docker:stable-dind
|
|
|
|
command: ["--experimental"]
|
|
|
|
|
|
|
|
variables:
|
|
|
|
IMAGE: "${CI_REGISTRY_IMAGE}"
|
|
|
|
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}"
|
2021-10-12 09:15:19 +00:00
|
|
|
BUILDIMAGE: "${CI_REGISTRY_IMAGE}/build:${CI_COMMIT_SHORT_SHA}"
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- image
|
|
|
|
- lint
|
|
|
|
- go-checks
|
|
|
|
- go-build
|
|
|
|
- unit-tests
|
|
|
|
- build
|
|
|
|
- build-long
|
|
|
|
- scan
|
|
|
|
- release
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
build-dev-image:
|
|
|
|
stage: image
|
|
|
|
script:
|
|
|
|
- apk --no-cache add make bash
|
|
|
|
- make .build-image
|
2021-10-12 09:15:19 +00:00
|
|
|
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
2021-07-01 14:16:33 +00:00
|
|
|
- make .push-build-image
|
|
|
|
|
|
|
|
.requires-build-image:
|
2021-10-12 09:15:19 +00:00
|
|
|
image: "${BUILDIMAGE}"
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
.go-check:
|
|
|
|
extends:
|
|
|
|
- .requires-build-image
|
|
|
|
stage: go-checks
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
extends:
|
|
|
|
- .go-check
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make assert-fmt
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
vet:
|
|
|
|
extends:
|
|
|
|
- .go-check
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make vet
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
extends:
|
|
|
|
- .go-check
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make lint
|
2021-07-01 14:16:33 +00:00
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
ineffassign:
|
|
|
|
extends:
|
|
|
|
- .go-check
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make ineffassign
|
2021-07-01 14:16:33 +00:00
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
misspell:
|
|
|
|
extends:
|
|
|
|
- .go-check
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make misspell
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
go-build:
|
|
|
|
extends:
|
|
|
|
- .requires-build-image
|
|
|
|
stage: go-build
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make build
|
2021-07-01 14:16:33 +00:00
|
|
|
|
|
|
|
unit-tests:
|
|
|
|
extends:
|
|
|
|
- .requires-build-image
|
|
|
|
stage: unit-tests
|
|
|
|
script:
|
2021-10-12 09:15:19 +00:00
|
|
|
- make coverage
|
2021-07-01 14:16:33 +00:00
|
|
|
|