github.com/itscaro/cli@v0.0.0-20190705081621-c9db0fe93829/circle.yml (about)

     1  version: 2
     2  
     3  jobs:
     4  
     5    lint:
     6      working_directory: /work
     7      docker: [{image: 'docker:18.03-git'}]
     8      steps:
     9        - checkout
    10        - setup_remote_docker:
    11              version: 18.03.1-ce
    12              reusable: true
    13              exclusive: false
    14        - run:
    15            command: docker version
    16        - run:
    17            name: "Lint"
    18            command: |
    19              docker build -f dockerfiles/Dockerfile.lint --tag cli-linter:$CIRCLE_BUILD_NUM .
    20              docker run --rm cli-linter:$CIRCLE_BUILD_NUM
    21  
    22    cross:
    23      working_directory: /work
    24      docker: [{image: 'docker:18.03-git'}]
    25      parallelism: 3
    26      steps:
    27        - checkout
    28        - setup_remote_docker:
    29              version: 18.03.1-ce
    30              reusable: true
    31              exclusive: false
    32        - run:
    33            name: "Cross"
    34            command: |
    35              docker build -f dockerfiles/Dockerfile.cross --tag cli-builder:$CIRCLE_BUILD_NUM .
    36              name=cross-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX
    37              docker run \
    38                  -e CROSS_GROUP=$CIRCLE_NODE_INDEX \
    39                  --name $name cli-builder:$CIRCLE_BUILD_NUM \
    40                  make cross
    41              docker cp \
    42                  $name:/go/src/github.com/docker/cli/build \
    43                  /work/build
    44        - store_artifacts:
    45            path: /work/build
    46  
    47    test:
    48      working_directory: /work
    49      docker: [{image: 'docker:18.03-git'}]
    50      steps:
    51        - checkout
    52        - setup_remote_docker:
    53              version: 18.03.1-ce
    54              reusable: true
    55              exclusive: false
    56        - run:
    57            name: "Unit Test with Coverage"
    58            command: |
    59              mkdir -p test-results/unit-tests
    60              docker build -f dockerfiles/Dockerfile.dev --tag cli-builder:$CIRCLE_BUILD_NUM .
    61              docker run \
    62                  -e GOTESTSUM_JUNITFILE=/tmp/junit.xml \
    63                  --name \
    64                  test-$CIRCLE_BUILD_NUM cli-builder:$CIRCLE_BUILD_NUM \
    65                  make test-coverage
    66              docker cp \
    67                  test-$CIRCLE_BUILD_NUM:/tmp/junit.xml \
    68                  ./test-results/unit-tests/junit.xml
    69        - run:
    70            name: "Upload to Codecov"
    71            command: |
    72              docker cp \
    73                  test-$CIRCLE_BUILD_NUM:/go/src/github.com/docker/cli/coverage.txt \
    74                  coverage.txt
    75              apk add -U bash curl
    76              curl -s https://codecov.io/bash | bash || \
    77                  echo 'Codecov failed to upload'
    78        - store_test_results:
    79            path:  test-results
    80        - store_artifacts:
    81            path:  test-results
    82  
    83    validate:
    84      working_directory: /work
    85      docker: [{image: 'docker:18.03-git'}]
    86      steps:
    87        - checkout
    88        - setup_remote_docker:
    89              version: 18.03.1-ce
    90              reusable: true
    91              exclusive: false
    92        - run:
    93            name: "Validate Vendor, Docs, and Code Generation"
    94            command: |
    95              rm -f .dockerignore # include .git
    96              docker build -f dockerfiles/Dockerfile.dev --tag cli-builder-with-git:$CIRCLE_BUILD_NUM .
    97              docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \
    98                  make ci-validate
    99            no_output_timeout: 15m
   100    shellcheck:
   101      working_directory: /work
   102      docker: [{image: 'docker:18.03-git'}]
   103      steps:
   104        - checkout
   105        - setup_remote_docker:
   106              version: 18.03.1-ce
   107              reusable: true
   108              exclusive: false
   109        - run:
   110            name: "Run shellcheck"
   111            command: |
   112              docker build -f dockerfiles/Dockerfile.shellcheck --tag cli-validator:$CIRCLE_BUILD_NUM .
   113              docker run --rm cli-validator:$CIRCLE_BUILD_NUM \
   114                  make shellcheck
   115  workflows:
   116    version: 2
   117    ci:
   118      jobs:
   119        - lint
   120        - cross
   121        - test
   122        - validate
   123        - shellcheck