...

Text file src/github.com/gorilla/websocket/.circleci/config.yml

Documentation: github.com/gorilla/websocket/.circleci

     1version: 2.1
     2
     3jobs:
     4  "test":
     5    parameters:
     6      version:
     7        type: string
     8        default: "latest"
     9      golint:
    10        type: boolean
    11        default: true
    12      modules:
    13        type: boolean
    14        default: true
    15      goproxy:
    16        type: string
    17        default: ""
    18    docker:
    19      - image: "cimg/go:<< parameters.version >>"
    20    working_directory: /home/circleci/project/go/src/github.com/gorilla/websocket
    21    environment:
    22      GO111MODULE: "on"
    23      GOPROXY: "<< parameters.goproxy >>"
    24    steps:
    25      - checkout
    26      - run:
    27          name: "Print the Go version"
    28          command: >
    29            go version
    30      - run:
    31          name: "Fetch dependencies"
    32          command: >
    33            if [[ << parameters.modules >> = true ]]; then
    34              go mod download
    35              export GO111MODULE=on
    36            else
    37              go get -v ./...
    38            fi
    39      # Only run gofmt, vet & lint against the latest Go version
    40      - run:
    41          name: "Run golint"
    42          command: >
    43            if [ << parameters.version >> = "latest" ] && [ << parameters.golint >> = true ]; then
    44              go get -u golang.org/x/lint/golint
    45              golint ./...
    46            fi
    47      - run:
    48          name: "Run gofmt"
    49          command: >
    50            if [[ << parameters.version >> = "latest" ]]; then
    51              diff -u <(echo -n) <(gofmt -d -e .)
    52            fi
    53      - run:
    54          name: "Run go vet"
    55          command: >
    56            if [[ << parameters.version >> = "latest" ]]; then
    57              go vet -v ./...
    58            fi
    59      - run:
    60          name: "Run go test (+ race detector)"
    61          command: >
    62            go test -v -race ./...
    63
    64workflows:
    65  tests:
    66    jobs:
    67      - test:
    68          matrix:
    69            parameters:
    70              version: ["1.18", "1.17", "1.16"]

View as plain text