2017-04-27 17:07:51 -04:00
|
|
|
version: 2
|
2017-06-14 18:44:06 -04:00
|
|
|
|
2017-04-27 17:07:51 -04:00
|
|
|
jobs:
|
2017-06-14 18:44:06 -04:00
|
|
|
|
|
|
|
test:
|
|
|
|
working_directory: /work
|
2021-06-09 07:44:09 -04:00
|
|
|
docker: [{image: 'docker:20.10-git'}]
|
2019-07-18 05:50:26 -04:00
|
|
|
environment:
|
|
|
|
DOCKER_BUILDKIT: 1
|
2017-06-14 18:44:06 -04:00
|
|
|
steps:
|
|
|
|
- checkout
|
2017-06-15 18:00:36 -04:00
|
|
|
- setup_remote_docker:
|
2021-06-09 07:44:09 -04:00
|
|
|
version: 20.10.6
|
2019-01-04 15:32:29 -05:00
|
|
|
reusable: true
|
|
|
|
exclusive: false
|
2017-05-03 20:55:52 -04:00
|
|
|
- run:
|
2019-10-24 09:49:01 -04:00
|
|
|
name: "Docker version"
|
|
|
|
command: docker version
|
|
|
|
- run:
|
|
|
|
name: "Docker info"
|
|
|
|
command: docker info
|
|
|
|
- run:
|
|
|
|
name: "Unit Test with Coverage - build image"
|
2017-05-03 20:55:52 -04:00
|
|
|
command: |
|
2019-02-01 05:56:27 -05:00
|
|
|
mkdir -p test-results/unit-tests
|
2019-07-18 05:57:20 -04:00
|
|
|
docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder:$CIRCLE_BUILD_NUM .
|
2019-10-24 09:49:01 -04:00
|
|
|
- run:
|
|
|
|
name: "Unit Test with Coverage"
|
|
|
|
command: |
|
2019-01-31 11:31:40 -05:00
|
|
|
docker run \
|
|
|
|
-e GOTESTSUM_JUNITFILE=/tmp/junit.xml \
|
|
|
|
--name \
|
2017-06-15 18:00:36 -04:00
|
|
|
test-$CIRCLE_BUILD_NUM cli-builder:$CIRCLE_BUILD_NUM \
|
|
|
|
make test-coverage
|
2019-01-31 11:31:40 -05:00
|
|
|
docker cp \
|
|
|
|
test-$CIRCLE_BUILD_NUM:/tmp/junit.xml \
|
2019-02-01 05:56:27 -05:00
|
|
|
./test-results/unit-tests/junit.xml
|
2017-06-14 18:44:06 -04:00
|
|
|
- run:
|
|
|
|
name: "Upload to Codecov"
|
|
|
|
command: |
|
2017-06-15 18:00:36 -04:00
|
|
|
docker cp \
|
|
|
|
test-$CIRCLE_BUILD_NUM:/go/src/github.com/docker/cli/coverage.txt \
|
|
|
|
coverage.txt
|
2017-05-18 10:42:05 -04:00
|
|
|
apk add -U bash curl
|
2017-08-15 13:17:20 -04:00
|
|
|
curl -s https://codecov.io/bash | bash || \
|
|
|
|
echo 'Codecov failed to upload'
|
2019-01-31 11:31:40 -05:00
|
|
|
- store_test_results:
|
|
|
|
path: test-results
|
2019-05-07 17:01:43 -04:00
|
|
|
- store_artifacts:
|
|
|
|
path: test-results
|
2017-06-14 18:44:06 -04:00
|
|
|
|
|
|
|
validate:
|
|
|
|
working_directory: /work
|
2021-06-09 07:44:09 -04:00
|
|
|
docker: [{image: 'docker:20.10-git'}]
|
2019-07-18 05:50:26 -04:00
|
|
|
environment:
|
|
|
|
DOCKER_BUILDKIT: 1
|
2017-06-14 18:44:06 -04:00
|
|
|
steps:
|
|
|
|
- checkout
|
2017-06-15 18:00:36 -04:00
|
|
|
- setup_remote_docker:
|
2021-06-09 07:44:09 -04:00
|
|
|
version: 20.10.6
|
2019-01-04 15:32:29 -05:00
|
|
|
reusable: true
|
|
|
|
exclusive: false
|
2017-05-02 16:40:29 -04:00
|
|
|
- run:
|
2019-10-24 09:49:01 -04:00
|
|
|
name: "Docker version"
|
|
|
|
command: docker version
|
|
|
|
- run:
|
|
|
|
name: "Docker info"
|
|
|
|
command: docker info
|
|
|
|
- run:
|
|
|
|
name: "Validate - build image"
|
2017-05-02 16:40:29 -04:00
|
|
|
command: |
|
2017-06-06 15:02:28 -04:00
|
|
|
rm -f .dockerignore # include .git
|
2019-07-18 05:57:20 -04:00
|
|
|
docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder-with-git:$CIRCLE_BUILD_NUM .
|
2019-10-24 09:49:01 -04:00
|
|
|
- run:
|
|
|
|
name: "Validate Vendor, Docs, and Code Generation"
|
|
|
|
command: |
|
2017-06-15 18:00:36 -04:00
|
|
|
docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \
|
2017-08-15 14:32:44 -04:00
|
|
|
make ci-validate
|
2019-03-18 08:07:22 -04:00
|
|
|
no_output_timeout: 15m
|
2019-10-24 09:49:01 -04:00
|
|
|
|
2017-06-14 18:44:06 -04:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
ci:
|
|
|
|
jobs:
|
|
|
|
- test
|
|
|
|
- validate
|