github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/.circleci/config.yml (about)

     1  version: 2
     2  
     3  jobs:
     4  
     5    lint:
     6      working_directory: /work
     7      docker: [{image: 'docker:20.10-git'}]
     8      environment:
     9        DOCKER_BUILDKIT: 1
    10      steps:
    11        - checkout
    12        - setup_remote_docker:
    13            version: 20.10.6
    14            reusable: true
    15            exclusive: false
    16        - run:
    17            name: "Docker version"
    18            command: docker version
    19        - run:
    20            name: "Docker info"
    21            command: docker info
    22        - run:
    23            name: "Shellcheck - build image"
    24            command: |
    25              docker build --progress=plain -f dockerfiles/Dockerfile.shellcheck --tag cli-validator:$CIRCLE_BUILD_NUM .
    26        - run:
    27            name: "Shellcheck"
    28            command: |
    29              docker run --rm cli-validator:$CIRCLE_BUILD_NUM \
    30                  make shellcheck
    31        - run:
    32            name: "Lint - build image"
    33            command: |
    34              docker build --progress=plain -f dockerfiles/Dockerfile.lint --tag cli-linter:$CIRCLE_BUILD_NUM .
    35        - run:
    36            name: "Lint"
    37            command: |
    38              docker run --rm cli-linter:$CIRCLE_BUILD_NUM
    39  
    40    cross:
    41      working_directory: /work
    42      docker: [{image: 'docker:20.10-git'}]
    43      environment:
    44        DOCKER_BUILDKIT: 1
    45        BUILDX_VERSION: "v0.8.2"
    46      parallelism: 3
    47      steps:
    48        - checkout
    49        - setup_remote_docker:
    50            version: 20.10.6
    51            reusable: true
    52            exclusive: false
    53        - run:
    54            name: "Docker version"
    55            command: docker version
    56        - run:
    57            name: "Docker info"
    58            command: docker info
    59        - run: apk add make curl
    60        - run: mkdir -vp ~/.docker/cli-plugins/
    61        - run: curl -fsSL --output ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-amd64
    62        - run: chmod a+x ~/.docker/cli-plugins/docker-buildx
    63        - run: docker buildx version
    64        - run: docker context create buildctx
    65        - run: docker buildx create --use buildctx && docker buildx inspect --bootstrap
    66        - run: GROUP_INDEX=$CIRCLE_NODE_INDEX GROUP_TOTAL=$CIRCLE_NODE_TOTAL docker buildx bake cross --progress=plain
    67        - store_artifacts:
    68            path: /work/build
    69  
    70    test:
    71      working_directory: /work
    72      docker: [{image: 'docker:20.10-git'}]
    73      environment:
    74        DOCKER_BUILDKIT: 1
    75      steps:
    76        - checkout
    77        - setup_remote_docker:
    78            version: 20.10.6
    79            reusable: true
    80            exclusive: false
    81        - run:
    82            name: "Docker version"
    83            command: docker version
    84        - run:
    85            name: "Docker info"
    86            command: docker info
    87        - run:
    88            name: "Unit Test with Coverage - build image"
    89            command: |
    90              mkdir -p test-results/unit-tests
    91              docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder:$CIRCLE_BUILD_NUM .
    92        - run:
    93            name: "Unit Test with Coverage"
    94            command: |
    95              docker run \
    96                  -e GOTESTSUM_JUNITFILE=/tmp/junit.xml \
    97                  --name \
    98                  test-$CIRCLE_BUILD_NUM cli-builder:$CIRCLE_BUILD_NUM \
    99                  make test-coverage
   100              docker cp \
   101                  test-$CIRCLE_BUILD_NUM:/tmp/junit.xml \
   102                  ./test-results/unit-tests/junit.xml
   103        - run:
   104            name: "Upload to Codecov"
   105            command: |
   106              docker cp \
   107                  test-$CIRCLE_BUILD_NUM:/go/src/github.com/docker/cli/coverage.txt \
   108                  coverage.txt
   109              apk add -U bash curl
   110              curl -s https://codecov.io/bash | bash || \
   111                  echo 'Codecov failed to upload'
   112        - store_test_results:
   113            path:  test-results
   114        - store_artifacts:
   115            path:  test-results
   116  
   117    validate:
   118      working_directory: /work
   119      docker: [{image: 'docker:20.10-git'}]
   120      environment:
   121        DOCKER_BUILDKIT: 1
   122      steps:
   123        - checkout
   124        - setup_remote_docker:
   125            version: 20.10.6
   126            reusable: true
   127            exclusive: false
   128        - run:
   129            name: "Docker version"
   130            command: docker version
   131        - run:
   132            name: "Docker info"
   133            command: docker info
   134        - run:
   135            name: "Validate - build image"
   136            command: |
   137              rm -f .dockerignore # include .git
   138              docker build --progress=plain -f dockerfiles/Dockerfile.dev --tag cli-builder-with-git:$CIRCLE_BUILD_NUM .
   139        - run:
   140            name: "Validate Vendor, Docs, and Code Generation"
   141            command: |
   142              docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \
   143                  make ci-validate
   144            no_output_timeout: 15m
   145  
   146  workflows:
   147    version: 2
   148    ci:
   149      jobs:
   150        - lint
   151        - cross
   152        - test
   153        - validate