github.com/filecoin-project/specs-actors/v4@v4.0.2/.circleci/config.yml (about)

     1  version: 2.1
     2  orbs:
     3    go: gotest/tools@0.0.9
     4    codecov: codecov/codecov@1.0.2
     5  
     6  executors:
     7    golang:
     8      docker:
     9        - image: circleci/golang:1.15
    10  
    11  commands:
    12    install-deps:
    13      steps:
    14        - go/install-ssh
    15        - go/install: {package: git}
    16    prepare:
    17      parameters:
    18        linux:
    19          default: true
    20          description: is a linux build environment?
    21          type: boolean
    22      steps:
    23        - checkout
    24        - when:
    25            condition: << parameters.linux >>
    26            steps:
    27              - run: sudo apt-get update
    28    build-all:
    29  
    30  
    31  jobs:
    32    mod-tidy-check:
    33      executor: golang
    34      steps:
    35        - install-deps
    36        - prepare
    37        - go/mod-download
    38        - go/mod-tidy-check
    39  
    40    build-all:
    41      executor: golang
    42      steps:
    43        - install-deps
    44        - prepare
    45        - go/mod-download
    46        - run:
    47            command: make build
    48        - store_artifacts:
    49            path: specs-actors
    50        - store_artifacts:
    51            path: specs-actors
    52  
    53    check-gen:
    54      executor: golang
    55      steps:
    56        - install-deps
    57        - prepare
    58        - go/mod-download
    59        - run:
    60            name: "Install goimports"
    61            command: |
    62              cd / && go get golang.org/x/tools/cmd/goimports
    63        - run:
    64            name: "Ensure we don't need to run 'make gen'"
    65            command: |
    66              make gen && git diff --exit-code
    67  
    68    test-all:
    69      executor: golang
    70      steps:
    71        - install-deps
    72        - prepare
    73        - go/mod-download
    74        - run:
    75            command: |
    76              make test-coverage
    77              mkdir -p /tmp/artifacts
    78              mv coverage.out /tmp/artifacts/coverage.out
    79        - codecov/upload:
    80            file: /tmp/artifacts/coverage.out
    81        - store_artifacts:
    82            path: specs-actors
    83  
    84    lint: &lint
    85      description: |
    86        Run golangci-lint.
    87      parameters:
    88        executor:
    89          type: executor
    90          default: golang
    91        golangci-lint-version:
    92          type: string
    93          default: 1.28.2
    94        concurrency:
    95          type: string
    96          default: '2'
    97          description: |
    98            Concurrency used to run linters. Defaults to 2 because NumCPU is not
    99            aware of container CPU limits.
   100        args:
   101          type: string
   102          default: ''
   103          description: |
   104            Arguments to pass to golangci-lint
   105      executor: << parameters.executor >>
   106      steps:
   107        - install-deps
   108        - prepare
   109        - run:
   110            command: make -j3 support/tools/bin/golangci-lint support/tools/bin/no-map-range.so
   111        - run:
   112            name: Lint
   113            command: |
   114              support/tools/bin/golangci-lint run -v \
   115                --concurrency << parameters.concurrency >> << parameters.args >>
   116  
   117    lint-all:
   118      <<: *lint
   119  
   120  workflows:
   121    version: 2.1
   122    ci:
   123      jobs:
   124        - lint-all
   125        - mod-tidy-check
   126        - build-all
   127        - test-all
   128        - check-gen