github.com/zaquestion/lab@v0.25.1/.gitlab-ci.yml (about)

     1  workflow:
     2    rules:
     3      # For merge requests, create a pipeline.
     4      - if: '$CI_MERGE_REQUEST_IID'
     5      # For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
     6      # - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
     7      # Temporarly create Ci for every branch:
     8      - if: '$CI_COMMIT_BRANCH'
     9      # For tags, create a pipeline.
    10      - if: '$CI_COMMIT_TAG'
    11      # For stable branches, create a pipeline.
    12      - if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable$/'
    13      #
    14  
    15  stages:
    16    - test
    17    - release
    18  
    19  default:
    20    image: golang:1.17
    21    tags:
    22      - gitlab-org
    23  
    24  # Disable DIND for SAST because we need to execute a before_script in the gosec-sast job
    25  variables:
    26    SAST_DISABLE_DIND: "true"
    27  
    28  include:
    29    - template: Security/SAST.gitlab-ci.yml
    30    - template: Security/Dependency-Scanning.gitlab-ci.yml
    31  
    32  gosec-sast:
    33    before_script:
    34      - apk add make
    35      - make install
    36  
    37  code_navigation:
    38    image: golang:1.17
    39    allow_failure: true
    40    script:
    41      - go get github.com/sourcegraph/lsif-go/cmd/lsif-go
    42      - lsif-go
    43    artifacts:
    44      reports:
    45        lsif: dump.lsif
    46  
    47  .test:
    48    # We limit concurrency because the integration tests execute _real_ actions in GitLab
    49    # By limiting the resource group we can ensure that only one test is run in parallel
    50    variables:
    51      GOPATH: "/builds/go"
    52      GIT_CLONE_PATH: $GOPATH/src/github.com/zaquestion/lab
    53      LAB_CORE_HOST: "https://gitlab.com"
    54      LAB_CORE_USER: "lab-testing"
    55      LAB_CORE_TOKEN: "uDz6czYV412zK-xC5mUu"
    56      CI_PROJECT_URL: $LAB_CORE_HOST
    57      GITLAB_USER_LOGIN: $LAB_CORE_USER
    58      CI_JOB_TOKEN: $CI_PROJECT_URL
    59    before_script:
    60      # Add a non-sensitive ssh key to allow lab to function.
    61      - mkdir ~/.ssh && chmod 700 ~/.ssh
    62      - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
    63      - echo -e "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkTcgXnHuqR0gbwegnr9Zxz4hTkjjV/SpgJNPJz7mo/HKNbx0rqjj1P0yGR053R9GSFFim2ut4NK9DPPUkQdyucw+DoLkYRHJmlJ4BNa9NTCD0sl+eSXO2969kZojCYSOgbmkCJx8mdgTwhzdgE/jhBrsY0hPE6pRTlU+H68/zeNdJUAIJf0LLXOm3hpTKLA19VICltl/j9VvBJpgRHdBylXEyL8HokYpjkQQk1ZXj3m7Nlo8yDdg4VcljOJWC+Xh8kxRMfK5x/VRVsYKCQXN5QlzKeqf7USRDUS/7mFoPUBW+d4kwKtGxRsWuIL2yeqzifZUTOgsh9+ZWAWxWffQZ your_email@example.com" > ~/.ssh/id_rsa.pub
    64      - echo -e "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA5E3IF5x7qkdIG8HoJ6/Wcc+IU5I41f0qYCTTyc+5qPxyjW8d\nK6o49T9MhkdOd0fRkhRYptrreDSvQzz1JEHcrnMPg6C5GERyZpSeATWvTUwg9LJf\nnklztvevZGaIwmEjoG5pAicfJnYE8Ic3YBP44Qa7GNITxOqUU5VPh+vP83jXSVAC\nCX9Cy1zpt4aUyiwNfVSApbZf4/VbwSaYER3QcpVxMi/B6JGKY5EEJNWV495uzZaP\nMg3YOFXJYziVgvl4fJMUTHyucf1UVbGCgkFzeUJcynqn+1EkQ1Ev+5haD1AVvneJ\nMCrRsUbFriC9snqs4n2VEzoLIffmVgFsVn30GQIDAQABAoIBAQDPQm2sQbti0mN8\nD4Uawl8D40v30n8WhUa7EbPTOmlqKAQ2sfDhex9KRbTLEmEBmImA/Eee8o9iCTIy\n8Fv8Fm6pUHt9G6Pti/XvemwW3Q3QNpSUkHqN0FDkgecQVqVBEb6uHo3mDm4RFINX\neOmkp30BjIK9/blEw1D0sFALLOEUPaDdPMwiXt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CvQPsA==\n-----END RSA PRIVATE KEY-----" > ~/.ssh/id_rsa
    65      - chmod 600 ~/.ssh/id_rsa*
    66      - eval $(ssh-agent -s)
    67      - ssh-add ~/.ssh/id_rsa
    68    script:
    69      - go version
    70      - export PATH=$GOPATH/bin:$PATH
    71      - export GIT_CLONE_PATH="$GOPATH/src/github.com/zaquestion/lab"
    72      - export LAB_CORE_HOST="https://gitlab.com"
    73      - export LAB_CORE_USER="lab-testing"
    74      - export LAB_CORE_TOKEN="uDz6czYV412zK-xC5mUu"
    75      - export CI_PROJECT_URL=$LAB_CORE_HOST
    76      - export GITLAB_USER_LOGIN=$LAB_CORE_USER
    77      - export CI_JOB_TOKEN=$LAB_CORE_TOKEN
    78      - export LAB_CORE_TEST="GITLAB"
    79      - make test
    80  
    81  test:
    82    stage: test
    83    extends: .test
    84    image: golang:1.17
    85  
    86  release:
    87    stage: release
    88    image: golang:1.17
    89    only:
    90      refs:
    91        - tags
    92    variables:
    93      GITHUB_TOKEN: $GITHUB_TOKEN
    94    script: |
    95      curl -sL https://git.io/goreleaser | GO111MODULE=on bash
    96  
    97  docs:
    98    stage: release
    99    image: golang:1.17
   100    only:
   101      refs:
   102        - tags
   103    script: |
   104      sed -i "s|lab version.\+$|lab version $(echo ${CI_COMMIT_TAG} | tr -d 'v')|" README.md
   105      DEPLOY=1 docs/build.sh