mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
f7e9d1ca45
This change uses the build image directly in CI instead of using dind and invoking the docker-* make targets. Signed-off-by: Evan Lezar <elezar@nvidia.com>
98 lines
1.8 KiB
YAML
98 lines
1.8 KiB
YAML
# 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}"
|
|
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
|
|
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
|
|
- make .push-build-image
|
|
|
|
.requires-build-image:
|
|
image: "${BUILDIMAGE}"
|
|
|
|
.go-check:
|
|
extends:
|
|
- .requires-build-image
|
|
stage: go-checks
|
|
|
|
fmt:
|
|
extends:
|
|
- .go-check
|
|
script:
|
|
- make assert-fmt
|
|
|
|
vet:
|
|
extends:
|
|
- .go-check
|
|
script:
|
|
- make vet
|
|
|
|
lint:
|
|
extends:
|
|
- .go-check
|
|
script:
|
|
- make lint
|
|
allow_failure: true
|
|
|
|
ineffassign:
|
|
extends:
|
|
- .go-check
|
|
script:
|
|
- make ineffassign
|
|
allow_failure: true
|
|
|
|
misspell:
|
|
extends:
|
|
- .go-check
|
|
script:
|
|
- make misspell
|
|
|
|
go-build:
|
|
extends:
|
|
- .requires-build-image
|
|
stage: go-build
|
|
script:
|
|
- make build
|
|
|
|
unit-tests:
|
|
extends:
|
|
- .requires-build-image
|
|
stage: unit-tests
|
|
script:
|
|
- make coverage
|
|
|