File: .gitlab-ci.yml

package info (click to toggle)
scilab 2024.1.0%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 381,880 kB
  • sloc: xml: 765,066; ansic: 285,813; cpp: 264,881; java: 172,629; fortran: 91,526; ml: 23,103; tcl: 16,853; makefile: 9,722; sh: 7,027; f90: 6,437; lex: 1,656; perl: 1,566; yacc: 1,308; php: 690; cs: 613; javascript: 50
file content (126 lines) | stat: -rw-r--r-- 4,897 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
# Copyright (C) Dassault Systemes - 2022 - Clement DAVID
# Copyright (C) Dassault Systemes - 2022 - Cedric DELAMARRE

stages:
  # refresh the Docker image
  - docker_setup
  # define common env variables used to build and tests
  - prebuild
  # build scilab
  - build
  # run the tests
  - test
  # run the ATOMS tests on a dedicated stage / Scilab install
  - test_atoms
  # extract some content
  - postbuild
  # publish and make it available to the community
  - publish
  # update/cleanup Docker image
  - docker_cleanup

variables:
  GIT_STRATEGY:
    value: "clone"
    description: "fastest strategy as it re-uses the local working copy"
  GIT_CLEAN_FLAGS:
    value: "-fxd"
    description: "do clean build, each job should clean previous artifacts at startup"
  GIT_DEPTH:
    value: "1"
    description: "speedup cloning, only fetch the latest commit"
  BRANCH:
    value: "${CI_COMMIT_BRANCH}${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
    description: "Scilab branch name to build"
  SCI_VERSION_STRING:
    value: "scilab-branch-${BRANCH}-${CI_COMMIT_SHORT_SHA}"
    description: "Scilab version string to set"
  DOCKER_LINUX_BUILDER:
    value: "${CI_REGISTRY_IMAGE}/linux-builder-${BRANCH}"
    description: "Docker image to build Scilab on Linux"
  DOCKER_LINUX_PREBUILD:
    value: "${CI_REGISTRY_IMAGE}/linux-prebuild-${BRANCH}"
    description: "Docker image to build Scilab prerequirements on Linux"
  DOCKER_WINDOWS_BUILDER:
    value: "${CI_REGISTRY_IMAGE}/windows-builder-${BRANCH}"
    description: "Docker image to build Scilab on Windows"
  DOCKER_TAG:
    value: "latest"
    description: "Docker tag to publish image on"
  SCILAB_COMMON_PATH:
    value: "${CI_PROJECT_DIR}\\..\\..\\..\\..\\scilab"
    description: "common windows path for persistency"
workflow:
  rules:
    # do not run on branches with opened merge request
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: never
    # run on contributor's fork with a specific version string
    - if: $CI_PROJECT_PATH_SLUG !~ /scilab-scilab/
      variables:
        GIT_STRATEGY: "fetch"
        GIT_CLEAN_FLAGS: "none"
        BRANCH: "${CI_DEFAULT_BRANCH}"
        SCI_VERSION_STRING: "${CI_PROJECT_PATH_SLUG}-${BRANCH}-${CI_COMMIT_SHORT_SHA}"
        DOCKER_LINUX_BUILDER: "registry.gitlab.com/scilab/scilab/linux-builder-${BRANCH}"
        DOCKER_LINUX_PREBUILD: "registry.gitlab.com/scilab/scilab/linux-prebuild-${BRANCH}"
        DOCKER_WINDOWS_BUILDER: "registry.gitlab.com/scilab/scilab/windows-builder-${BRANCH}"
    # Scheduled pipeline
    - if: $CI_PIPELINE_SOURCE == "schedule"
    # Release, use the default branch and prebuild docker images
    - if: $CI_COMMIT_TAG
      variables:
        BRANCH: "${CI_DEFAULT_BRANCH}"
        SCI_VERSION_STRING: "scilab-${CI_COMMIT_TAG}"
        DOCKER_LINUX_BUILDER: "${CI_REGISTRY_IMAGE}/linux-builder-${BRANCH}"
        DOCKER_LINUX_PREBUILD: "${CI_REGISTRY_IMAGE}/linux-prebuild-${BRANCH}"
        DOCKER_WINDOWS_BUILDER: "${CI_REGISTRY_IMAGE}/windows-builder-${BRANCH}"
    # on merge request with env. modification, set specific docker image tag
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes: &DOCKER_CHANGES
        paths:
          - .gitlab-ci.yml
          - .gitlab-ci/docker_setup.yml
          - .gitlab-ci/docker_setup.sh
          - .gitlab-ci/Dockerfile*
          - .gitlab-ci/linux-images/Dockerfile*
      variables:
        GIT_STRATEGY: "fetch"
        GIT_CLEAN_FLAGS: "-fX **.bin **/lib"
        BRANCH: "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
        SCI_VERSION_STRING: "scilab-mr${CI_MERGE_REQUEST_IID}-${CI_COMMIT_SHORT_SHA}"
        DOCKER_LINUX_BUILDER: "${CI_REGISTRY_IMAGE}/linux-builder-${BRANCH}"
        DOCKER_LINUX_PREBUILD: "${CI_REGISTRY_IMAGE}/linux-prebuild-${BRANCH}"
        DOCKER_WINDOWS_BUILDER: "${CI_REGISTRY_IMAGE}/windows-builder-${BRANCH}"
        DOCKER_TAG: "mr${CI_MERGE_REQUEST_IID}"
    # run on merge request
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      variables:
        GIT_STRATEGY: "fetch"
        GIT_CLEAN_FLAGS: "-fX **.bin **/lib"
        SCI_VERSION_STRING: "scilab-mr${CI_MERGE_REQUEST_IID}-${CI_COMMIT_SHORT_SHA}"
    # update docker images after a MR merge
    - if: $CI_PIPELINE_SOURCE == "push"
      changes: *DOCKER_CHANGES
    # Run on other cases (web, api, etc..), default variables may be modified
    - if: $CI_PIPELINE_SOURCE != "push"
      when: always

default:
  artifacts:
    expire_in: 1 day

include:
  # Setup Docker
  - local: .gitlab-ci/docker_setup.yml
  # updating files and runner states
  - local: .gitlab-ci/prebuild.yml
  # build
  - local: .gitlab-ci/build.yml
  # execute tests
  - local: .gitlab-ci/test.yml
  # sign and extract useful content
  - local: .gitlab-ci/postbuild.yml
  # deploy/publish a binary
  - local: .gitlab-ci/publish.yml