nvidia-container-toolkit/.common-ci.yml

98 lines
1.8 KiB
YAML
Raw Normal View History

# 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-18 12:33:55 +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
build-dev-image:
stage: image
script:
- apk --no-cache add make bash
- make .build-image
2021-10-18 12:33:55 +00:00
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- make .push-build-image
.requires-build-image:
2021-10-18 12:33:55 +00:00
image: "${BUILDIMAGE}"
.go-check:
extends:
- .requires-build-image
stage: go-checks
fmt:
extends:
- .go-check
script:
2021-10-18 12:33:55 +00:00
- make assert-fmt
vet:
extends:
- .go-check
script:
2021-10-18 12:33:55 +00:00
- make vet
lint:
extends:
- .go-check
script:
2021-10-18 12:33:55 +00:00
- make lint
allow_failure: true
ineffassign:
extends:
- .go-check
script:
2021-10-18 12:33:55 +00:00
- make ineffassign
allow_failure: true
misspell:
extends:
- .go-check
script:
2021-10-18 12:33:55 +00:00
- make misspell
go-build:
extends:
- .requires-build-image
stage: go-build
script:
2021-10-18 12:33:55 +00:00
- make build
unit-tests:
extends:
- .requires-build-image
stage: unit-tests
script:
2021-10-18 12:33:55 +00:00
- make coverage