github.com/instana/go-sensor@v1.62.2-0.20240520081010-4919868049e1/.tekton/ci-build/pipeline.yaml (about)

     1  # (c) Copyright IBM Corp. 2024
     2  
     3  apiVersion: tekton.dev/v1
     4  kind: Pipeline
     5  metadata:
     6    name: go-tracer-ci-pipeline
     7  spec:
     8    params:
     9    - name: revision
    10      type: string
    11    - name: git-commit-sha
    12      type: string
    13    - name: go-version
    14      type: string
    15    - name: excludeDirs
    16      type: string
    17    workspaces:
    18      - name: go-tracer-ci-pipeline-pvc
    19      - name: cache-pvc
    20    tasks:
    21  
    22      - name: github-set-check-status-to-pending
    23        taskRef:
    24          kind: Task
    25          name: github-set-status
    26        params:
    27        - name: SHA
    28          value: $(params.git-commit-sha)
    29        - name: STATE
    30          value: pending
    31        - name: PIPELINE_RUN_NAME
    32          value: $(context.pipelineRun.name)
    33        - name: go-version
    34          value: $(params.go-version)
    35  
    36      - name: clone
    37        params:
    38        - name: revision
    39          value: $(params.revision)
    40        - name: SHA
    41          value: $(params.git-commit-sha)
    42        taskRef:
    43          name: go-tracer-clone-task
    44        workspaces:
    45          - name: task-pvc
    46            workspace: go-tracer-ci-pipeline-pvc
    47      # TODO : Revisit cache implementation. Disabling cache for now, as it causes memory issues.
    48      
    49      # - name: cache-restore
    50      #   params:
    51      #   - name: imageTag
    52      #     value: $(params.go-version)
    53      #   taskRef:
    54      #     name: go-tracer-cache-restore-task
    55      #   workspaces:
    56      #     - name: task-pvc
    57      #       workspace: go-tracer-ci-pipeline-pvc
    58      #     - name: cache-pvc
    59      #       workspace: cache-pvc
    60  
    61      - name: go-fmt
    62        runAfter:
    63          - clone
    64        params:
    65        - name: imageTag
    66          value: $(params.go-version)
    67        - name: excludeDirs
    68          value: $(params.excludeDirs)
    69        taskRef:
    70          name: go-tracer-gofmt-task
    71        workspaces:
    72          - name: task-pvc
    73            workspace: go-tracer-ci-pipeline-pvc
    74  
    75      - name: go-imports
    76        runAfter:
    77          - go-fmt
    78        params:
    79        - name: imageTag
    80          value: $(params.go-version)
    81        - name: excludeDirs
    82          value: $(params.excludeDirs)
    83        taskRef:
    84          name: go-tracer-goimports-task
    85        workspaces:
    86          - name: task-pvc
    87            workspace: go-tracer-ci-pipeline-pvc
    88      
    89      - name: unit-test
    90        runAfter:
    91          - go-imports
    92          # - cache-restore
    93        params:
    94        - name: imageTag
    95          value: $(params.go-version)
    96        - name: excludeDirs
    97          value: $(params.excludeDirs)
    98        taskRef:
    99          name: go-tracer-unittest-task
   100        workspaces:
   101          - name: task-pvc
   102            workspace: go-tracer-ci-pipeline-pvc
   103          - name: cache-pvc
   104            workspace: cache-pvc
   105  
   106      - name: integration-test-common
   107        runAfter:
   108          - unit-test
   109        params:
   110        - name: imageTag
   111          value: $(params.go-version)
   112        - name: excludeDirs
   113          value: $(params.excludeDirs)
   114        taskRef:
   115          name: go-tracer-integration-common-task
   116        workspaces:
   117          - name: task-pvc
   118            workspace: go-tracer-ci-pipeline-pvc
   119          - name: cache-pvc
   120            workspace: cache-pvc
   121  
   122      - name: integration-test-couchbase
   123        runAfter:
   124          - integration-test-common
   125        when:
   126          - input: "$(params.go-version)"
   127            operator: in
   128            values: ["1.22"]
   129        params:
   130        - name: imageTag
   131          value: $(params.go-version)
   132        - name: excludeDirs
   133          value: $(params.excludeDirs)
   134        taskRef:
   135          name: go-tracer-integration-couchbase-task
   136        workspaces:
   137          - name: task-pvc
   138            workspace: go-tracer-ci-pipeline-pvc
   139          - name: cache-pvc
   140            workspace: cache-pvc
   141  
   142      # - name: cache-update
   143      #   runAfter:
   144      #     - integration-test-couchbase
   145      #   params:
   146      #   - name: imageTag
   147      #     value: $(params.go-version)
   148      #   taskRef:
   149      #     name: go-tracer-cache-update-task
   150      #   workspaces:
   151      #     - name: task-pvc
   152      #       workspace: go-tracer-ci-pipeline-pvc
   153      #     - name: cache-pvc
   154      #       workspace: cache-pvc
   155  
   156    finally:
   157      - name: github-set-check-status-to-success-or-failure
   158        taskRef:
   159          kind: Task
   160          name: github-set-status
   161        params:
   162        - name: SHA
   163          value: $(params.git-commit-sha)
   164        - name: STATE
   165          value: "$(tasks.status)"
   166        - name: PIPELINE_RUN_NAME
   167          value: $(context.pipelineRun.name)
   168        - name: go-version
   169          value: $(params.go-version)