github.com/clusterize-io/tusk@v0.6.3-0.20211001020217-cfe8a8cd0d4a/crd.yaml (about)

     1  ---
     2  tasks:
     3    bootstrap:
     4      usage: Set up app dependencies for first time use
     5      description: |
     6        Install all dependencies for building, formatting, and testing the
     7        application.
     8      options:
     9        bin-dir:
    10          usage: The location for binary files. Defaults to /usr/local/bin
    11          default: /usr/local/bin
    12        golangci-url:
    13          private: true
    14          default: https://install.goreleaser.com/github.com/golangci/golangci-lint.sh
    15        golangci-version:
    16          private: true
    17          default: 1.39.0
    18      run:
    19        - when:
    20            command: golangci-lint --version | grep -qv ${golangci-version}
    21          command: curl -fLSs ${golangci-url} | bash -s -- -b ${bin-dir} v${golangci-version}
    22        - when:
    23            command: "! command -v goimports"
    24          command: go install golang.org/x/tools/cmd/goimports@latest
    25  
    26    lint:
    27      usage: Run static analysis
    28      description: |
    29        Runs golangci-lint using the configuration specified in .golangci.toml
    30      options:
    31        fast:
    32          usage: Only run fast linters
    33          type: bool
    34          short: f
    35        opts:
    36          private: true
    37          default:
    38            when: fast
    39            value: --fast
    40      run: golangci-lint run ${opts} ./...
    41  
    42    test:
    43      usage: Run the tests
    44      description: |
    45        Runs the full test suite using `go test -cover ./...`.
    46      options:
    47        all:
    48          usage: Run all tests and linters
    49          short: a
    50          type: bool
    51          default: false
    52        fast:
    53          usage: Only run fast tests
    54          type: bool
    55        verbose:
    56          usage: Run the tests in verbose mode
    57          short: v
    58          type: bool
    59        verbose-string:
    60          private: true
    61          default:
    62            when: verbose
    63            value: -v
    64        short-string:
    65          private: true
    66          default:
    67            when: fast
    68            value: -short
    69      run:
    70        - when: all
    71          task:
    72            name: lint
    73            options:
    74              fast: ${fast}
    75        - command: go test -cover -race ${verbose-string} ${short-string} ./...
    76  
    77    tidy:
    78      usage: Clean up and format the repo
    79      run:
    80        - go mod tidy
    81        - goimports -w .
    82  
    83    release:
    84      usage: Release the latest version with goreleaser
    85      options:
    86        snapshot:
    87          usage: Release without publishing or validation
    88          type: bool
    89        snapshot-flags:
    90          private: true
    91          default:
    92            when: snapshot
    93            value: --snapshot
    94      run: |
    95        header='^## [0-9]+\.[0-9]+\.[0-9]+'
    96        awk "/${header}/{if(!found){found=1;f=1}else{f=0}} f" CHANGELOG.md |
    97            goreleaser --rm-dist --release-notes /dev/stdin ${snapshot-flags}