gitlab.com/SkynetLabs/skyd@v1.6.9/.gitlab-ci.yml (about)

     1  ###############################################
     2  # Define stages of the CI
     3  ###############################################
     4  stages:
     5    - lint
     6    - test
     7    - deploy
     8  
     9  ###############################################
    10  # Define the package variables for the tests
    11  ###############################################
    12  variables:
    13    legacy_pkgs: >-
    14      ./node
    15      ./node/api
    16      ./node/api/server
    17    package_renter_pkgs: >-
    18      ./skymodules/renter
    19      ./skymodules/renter/contractor
    20      ./skymodules/renter/filesystem
    21      ./skymodules/renter/filesystem/siafile
    22      ./skymodules/renter/filesystem/siadir
    23    package_renter_2_pkgs: >-
    24      ./skymodules/renter/hostdb
    25      ./skymodules/renter/hostdb/hosttree
    26      ./skymodules/renter/proto
    27      ./skymodules/renter/skynetblocklist
    28      ./skymodules/renter/skynetportals
    29    package_pkgs: >-
    30      ./build
    31      ./cmd/skyc
    32      ./cmd/skyd
    33      ./cmd/skynet-benchmark
    34      ./compatibility
    35      ./skymodules
    36      ./skymodules/accounting
    37      ./profile
    38      ./skykey
    39    siatest_pkgs: >-
    40      ./siatest
    41      ./siatest/accounting
    42      ./siatest/daemon
    43    siatest_renter_pkgs: >-
    44      ./siatest/renter
    45    siatest_renter_sub_pkgs: >-
    46      ./siatest/renter/hostdb
    47      ./siatest/renterhost
    48    siatest_renter_contractor_pkg: >-
    49      ./siatest/renter/contractor
    50    siatest_renter_suite_pkg: >-
    51      ./siatest/renter/suite
    52    siatest_skynet_pkgs: >-
    53      ./siatest/skynet
    54    docker_hub_dev_hook: https://hub.docker.com/api/build/v1/source/57afb708-6926-411b-98fc-44c79f59097c/trigger/513a6d92-9f8b-4f04-b20a-ebd51b193b5d/call/
    55  
    56  ###############################################
    57  # Define common stage parameters
    58  ###############################################
    59  default: &default_params
    60    ## Run tests with most recent golang version to take advantage of any perf
    61    ## improvements.
    62    image: nebulouslabs/sia-ci
    63    before_script:
    64      - date
    65      - go version
    66      - mkdir -p .cache/gocache
    67      - export PATH=$PATH:$CI_PROJECT_DIR/.cache/bin/
    68      - export GOPATH="$CI_PROJECT_DIR/.cache"
    69  
    70  ## Default common test params for regular and nightly pipelines
    71  .default_test_common: &default_test_common_params
    72    artifacts:
    73      name: "SiaTesting-$CI_JOB_NAME"
    74      paths:
    75        - $CI_PROJECT_DIR/SiaTesting
    76        - $CI_PROJECT_DIR/cover/cover.out
    77      when: always
    78  
    79    after_script:
    80      - cp -R /tmp/SiaTesting $CI_PROJECT_DIR/SiaTesting
    81  
    82    services:
    83      - name: bitnami/mongodb:4.4.1
    84        alias: mongo
    85  
    86    variables:
    87      FF_NETWORK_PER_BUILD: 1
    88      # Configure mongodb environment variables
    89      MONGODB_ADVERTISED_HOSTNAME: mongo
    90      MONGODB_URI: mongodb://mongo:27017
    91      MONGODB_REPLICA_SET_MODE: primary
    92      MONGODB_PRIMARY_HOST: localhost
    93      MONGODB_ROOT_PASSWORD: pwd
    94      MONGODB_REPLICA_SET_KEY: testkey
    95  
    96  ## Default common test params for regular and nightly pipelines
    97  ## for Windows runner.
    98  .default_test_common_windows: &default_test_common_windows_params
    99    artifacts:
   100      name: "SiaTesting-$CI_JOB_NAME"
   101      paths:
   102        - $CI_PROJECT_DIR/SiaTesting
   103        - $CI_PROJECT_DIR/cover/cover.out
   104      when: always
   105  
   106    after_script:
   107      - XCOPY "C:\Windows\Temp\SiaTesting\*" "$CI_PROJECT_DIR\SiaTesting" /S /I /Y > $null
   108  
   109  ## Default params for Windows runner
   110  .default_windows: &default_windows_params
   111    before_script:
   112      - Get-Date -format r
   113      - go version
   114      - $env:USERNAME
   115      - New-Item -ItemType Directory -Force .cache\gocache
   116      - $env:PATH += ";$CI_PROJECT_DIR\.cache\bin"
   117      - $env:PATH
   118      - $env:GOPATH = "$CI_PROJECT_DIR\.cache"
   119      - $env:GOPATH
   120  
   121  ## Define the default test parameters.
   122  .default_test: &default_test_params ## Merge the contents of aliases
   123    <<: *default_params
   124    <<: *default_test_common_params
   125    stage: test
   126  
   127    ## disable default tests for scheduled pipelines (nightlies)
   128    except:
   129      - schedules
   130  
   131  ## Define the default test parameters
   132  ## for Windows runner.
   133  .default_windows_test:
   134    &default_test_windows_params ## Merge the contents of aliases
   135    <<: *default_windows_params
   136    <<: *default_test_common_windows_params
   137    stage: test
   138    tags:
   139      - nebulous-windows
   140  
   141    ## disable default tests for scheduled pipelines (nightlies)
   142    except:
   143      - schedules
   144  
   145  ## Define the default nightly test parameters.
   146  .default_nightly_test: &default_nightly_params ## Merge the contents of aliases
   147    <<: *default_test_params
   148    <<: *default_test_common_params
   149    ## Only run during scheduled pipelines.
   150    except:
   151      - ""
   152    only:
   153      - schedules
   154  
   155  ## Define the default nightly test parameters
   156  ## for Windows runner.
   157  .default_nightly_windows_test:
   158    &default_nightly_windows_params ## Merge the contents of aliases
   159    <<: *default_test_windows_params
   160    <<: *default_test_common_windows_params
   161    ## Only run during scheduled pipelines.
   162    except:
   163      - ""
   164    only:
   165      - schedules
   166  
   167  ###############################################
   168  # Define specific stage parameters
   169  ###############################################
   170  
   171  #################
   172  # Lint Stage
   173  #################
   174  lint:
   175    stage: lint
   176    cache:
   177      key: lint-cache
   178      paths:
   179        - .cache
   180    script:
   181      - export GOCACHE=$CI_PROJECT_DIR/.cache/gocache
   182      - make vet
   183      - make lint
   184      - make markdown-spellcheck
   185      - make test
   186  
   187  #################
   188  # Build Stage
   189  #################
   190  build:
   191    stage: lint
   192    ## go 1.13 is the minimum accepted version for building Sia.
   193    image: nebulouslabs/sia-ci
   194    artifacts:
   195      name: "Binaries"
   196      paths:
   197        - $CI_PROJECT_DIR/artifacts
   198    script:
   199      - ./check-builds.sh
   200  
   201  #################
   202  # Deploy Stage
   203  #################
   204  deploy:
   205    stage: deploy
   206    script:
   207      - curl -X POST -H "Content-Type:application/json" --data '{"name":"'"$CI_COMMIT_REF_NAME"'"}' $docker_hub_dev_hook
   208    only:
   209      - master
   210  
   211  ############################
   212  # Linux Tests
   213  ############################
   214  
   215  #################
   216  # Legacy Test
   217  #################
   218  legacy-tests:
   219    <<: *default_test_params
   220    cache:
   221      key: legacy-cache
   222      paths:
   223        - .cache
   224    script:
   225      - make test-long mongouri=$MONGODB_URI run=. pkgs="$legacy_pkgs"
   226  
   227  #################
   228  # Package Tests
   229  #################
   230  package-renter-tests:
   231    <<: *default_test_params
   232    cache:
   233      key: package-cache
   234      paths:
   235        - .cache
   236    script:
   237      - make test-long mongouri=$MONGODB_URI run=. pkgs="$package_renter_pkgs"
   238  
   239  package-renter-2-tests:
   240    <<: *default_test_params
   241    cache:
   242      key: package-cache
   243      paths:
   244        - .cache
   245    script:
   246      - make test-long mongouri=$MONGODB_URI run=. pkgs="$package_renter_2_pkgs"
   247  
   248  package-tests:
   249    <<: *default_test_params
   250    cache:
   251      key: package-cache
   252      paths:
   253        - .cache
   254    script:
   255      - make test-long mongouri=$MONGODB_URI run=. pkgs="$package_pkgs"
   256  
   257  #################
   258  # Siatest Tests
   259  #################
   260  siatest-tests:
   261    <<: *default_test_params
   262    cache:
   263      key: siatest-cache
   264      paths:
   265        - .cache
   266    script:
   267      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_pkgs"
   268  
   269  siatest-renter-tests:
   270    <<: *default_test_params
   271    cache:
   272      key: siatest-renter-tests-cache
   273      paths:
   274        - .cache
   275    script:
   276      - apt-get update
   277      - apt-get install -y fuse
   278      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_pkgs"
   279  
   280  siatest-renter-sub-tests:
   281    <<: *default_test_params
   282    cache:
   283      key: siatest-renter-sub-tests-cache
   284      paths:
   285        - .cache
   286    script:
   287      - apt-get update
   288      - apt-get install -y fuse
   289      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_sub_pkgs"
   290  
   291  siatest-renter-contractor-tests:
   292    <<: *default_test_params
   293    cache:
   294      key: siatest-renter-contractor-tests-cache
   295      paths:
   296        - .cache
   297    script:
   298      - apt-get update
   299      - apt-get install -y fuse
   300      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_contractor_pkg"
   301  
   302  siatest-renter-suite-tests:
   303    <<: *default_test_params
   304    cache:
   305      key: siatest-renter-suite-tests-cache
   306      paths:
   307        - .cache
   308    script:
   309      - apt-get update
   310      - apt-get install -y fuse
   311      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_suite_pkg"
   312  
   313  siatest-skynet-tests:
   314    <<: *default_test_params
   315    cache:
   316      key: siatest-skynet-tests-cache
   317      paths:
   318        - .cache
   319    script:
   320      - apt-get update
   321      - apt-get install -y fuse
   322      - make test-long mongouri=$MONGODB_URI run=. pkgs="$siatest_skynet_pkgs"
   323  
   324  ############################
   325  # Nightly Tests
   326  ############################
   327  
   328  #################
   329  # Legacy Test
   330  #################
   331  legacy-tests-nightly:
   332    <<: *default_nightly_params
   333    script:
   334      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$legacy_pkgs"
   335  
   336  # Windows execution
   337  legacy-windows-tests-nightly:
   338    <<: *default_nightly_windows_params
   339    script:
   340      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$legacy_pkgs"
   341  
   342  #################
   343  # Package Test
   344  #################
   345  # Windows execution
   346  package-renter-tests-nightly:
   347    <<: *default_nightly_params
   348    script:
   349      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$package_renter_pkgs"
   350  
   351  package-renter-2-tests-nightly:
   352    <<: *default_nightly_params
   353    script:
   354      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$package_renter_2_pkgs"
   355  
   356  # Windows execution
   357  package-renter-windows-tests-nightly:
   358    <<: *default_nightly_windows_params
   359    script:
   360      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$package_renter_pkgs"
   361  
   362  package-renter-2-windows-tests-nightly:
   363    <<: *default_nightly_windows_params
   364    script:
   365      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$package_renter_2_pkgs"
   366  
   367  package-tests-nightly:
   368    <<: *default_nightly_params
   369    script:
   370      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$package_pkgs"
   371  
   372  # Windows execution
   373  package-windows-tests-nightly:
   374    <<: *default_nightly_windows_params
   375    script:
   376      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$package_pkgs"
   377  
   378  #################
   379  # Siatest Test
   380  #################
   381  siatest-tests-nightly:
   382    <<: *default_nightly_params
   383    script:
   384      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_pkgs"
   385  
   386  # Windows execution
   387  siatest-windows-tests-nightly:
   388    <<: *default_nightly_windows_params
   389    script:
   390      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_pkgs"
   391  
   392  siatest-renter-tests-nightly:
   393    <<: *default_nightly_params
   394    script:
   395      - apt-get update
   396      - apt-get install -y fuse
   397      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_pkgs"
   398  
   399  # Windows execution
   400  siatest-renter-windows-tests-nightly:
   401    <<: *default_nightly_windows_params
   402    script:
   403      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_pkgs"
   404  
   405  siatest-renter-sub-tests-nightly:
   406    <<: *default_nightly_params
   407    script:
   408      - apt-get update
   409      - apt-get install -y fuse
   410      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_sub_pkgs"
   411  
   412  siatest-renter-contractor-tests-nightly:
   413    <<: *default_nightly_params
   414    script:
   415      - apt-get update
   416      - apt-get install -y fuse
   417      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_contractor_pkg"
   418  
   419  siatest-renter-suite-tests-nightly:
   420    <<: *default_nightly_params
   421    script:
   422      - apt-get update
   423      - apt-get install -y fuse
   424      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_suite_pkg"
   425  
   426  # Windows execution
   427  siatest-renter-sub-windows-tests-nightly:
   428    <<: *default_nightly_windows_params
   429    script:
   430      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_sub_pkgs"
   431  
   432  siatest-renter-contractor-windows-tests-nightly:
   433    <<: *default_nightly_windows_params
   434    script:
   435      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_contractor_pkg"
   436  
   437  siatest-renter-suite-windows-tests-nightly:
   438    <<: *default_nightly_windows_params
   439    script:
   440      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_renter_suite_pkg"
   441  
   442  siatest-skynet-tests-nightly:
   443    <<: *default_nightly_params
   444    script:
   445      - apt-get update
   446      - apt-get install -y fuse
   447      - make test-vlong mongouri=$MONGODB_URI run=. pkgs="$siatest_skynet_pkgs"
   448  
   449  # Windows execution
   450  siatest-skynet-windows-tests-nightly:
   451    <<: *default_nightly_windows_params
   452    script:
   453      - make test-vlong-windows mongouri=$MONGODB_URI run=. pkgs="$siatest_skynet_pkgs"
   454  ############################
   455  # Antfarm Tests
   456  ############################
   457  # TODO:
   458  # Enable antfarm test triger when the following permission issue is fixed:
   459  # https://gitlab.com/gitlab-org/gitlab/-/issues/299433
   460  # Updates to master and nightly schedule pipelines will trigger Sia Antfarm
   461  # version tests
   462  # antfarm-version-tests:
   463  #   stage: test
   464  #   trigger:
   465  #     project: NebulousLabs/Sia-Ant-Farm
   466  #     # strategy: depend
   467  #   variables:
   468  #     PARENT_CI_PIPELINE_SOURCE: $CI_PIPELINE_SOURCE
   469  #   only:
   470  #     - master