.gitlab-ci.yml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ###################### Begin Defaults
  2. stages:
  3. - all
  4. variables:
  5. GIT_DEPTH: 0
  6. GIT_STRATEGY: clone
  7. default:
  8. before_script:
  9. - |
  10. # before_script
  11. echo "Starting before_script actions."
  12. echo "Finished before_script actions."
  13. after_script:
  14. - |
  15. # after_script
  16. echo "Starting after_script actions."
  17. echo "Finished after_script actions."
  18. ###################### End Defaults
  19. ###################### Begin Common Blocks
  20. .scriptCommon: &scriptCommon |
  21. # scriptCommon
  22. echo "Project Name : $CI_PROJECT_TITLE"
  23. echo "Project Git Commit : $CI_COMMIT_SHA"
  24. echo "Project Git Branch : $CI_COMMIT_BRANCH"
  25. echo "GitLab CI User Details : $GITLAB_USER_LOGIN - $GITLAB_USER_NAME ($GITLAB_USER_ID) $GITLAB_USER_EMAIL"
  26. echo "GitLab CI Job Name : $CI_JOB_NAME"
  27. echo "GitLab CI Job ID : $CI_JOB_ID"
  28. echo "GitLab CI Job Stage : $CI_JOB_STAGE"
  29. echo "GitLab CI Runner Details : $CI_RUNNER_VERSION ($CI_RUNNER_REVISION)"
  30. .scriptGoVersion: &scriptGoVersion |
  31. # scriptGoVersion
  32. echo "Go Compiler Version:"
  33. go version
  34. echo "Go Default Environment:"
  35. go env
  36. echo "Go Current Environment:"
  37. go tool dist env -p
  38. .scriptGitPre: &scriptGitPre |
  39. # scriptGitPre
  40. git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
  41. git --no-pager fetch --tags
  42. git --no-pager fetch --all --recurse-submodules=yes
  43. git --no-pager update-index -q --refresh --really-refresh
  44. git --no-pager for-each-ref --count=1
  45. git --no-pager reset --hard
  46. git --no-pager diff --full-index --exit-code
  47. ###################### End Common Blocks
  48. ###################### Begin Linux
  49. linux job:
  50. tags:
  51. - Linux-x86_64
  52. stage: all
  53. script:
  54. - *scriptCommon
  55. - |
  56. # upgrade system, install development tools
  57. - yum install dnf -y
  58. - yum clean all -y
  59. - dnf upgrade --refresh -y
  60. - dnf groupinstall "Development Tools" -y
  61. - dnf install epel-release centos-release-scl centos-release-scl-rh -y
  62. - dnf install upx ccache pv valgrind graphviz clang zsh scl-utils devtoolset-9 -y
  63. - dnf groupupdate base -y
  64. - source /opt/rh/devtoolset-9/enable
  65. - dnf clean all -y
  66. - |
  67. # gimme go stable (latest release)
  68. bash --norc --noprofile --posix -o pipefail -c "set -e && mkdir -p /tools/bin && curl -fsSL -o /tools/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme && chmod a+x /tools/bin/gimme"
  69. bash --norc --noprofile --posix -o pipefail -c "set -e && mkdir -p /tools/gimme && GIMME_SILENT_ENV=1 GIMME_ENV_PREFIX=/tools/gimme/env GIMME_VERSION_PREFIX=/tools/gimme/ver GIMME_GO_VERSION=stable GIMME_CGO_ENABLED=1 /tools/bin/gimme" > /tools/genv && source /tools/genv
  70. - source /tools/genv
  71. - go env -w GO111MODULE=on && export GO111MODULE=on
  72. - export GOPROXY="https://proxy.golang.org,direct" && go env -w GOPROXY="${GOPROXY:?}"
  73. - *scriptGoVersion
  74. - go clean -modcache -cache -r -x
  75. - *scriptGitPre
  76. - export GO=`which go` && gmake build && printf %s\\n "It built!"
  77. ###################### End Linux Build + Test