|
1 | 1 | stages: |
2 | 2 | - build |
3 | 3 | - test |
| 4 | + - optional |
4 | 5 | - check |
5 | | - - run_downstream_ci |
6 | 6 |
|
7 | | -issue-check: |
8 | | - services: |
9 | | - - image:e3 |
10 | | - stage: check |
11 | | - needs: [] # Do not wait for the other stages to execute |
12 | | - interruptible: true # Cancel job if the branch is pushed |
13 | | - variables: # do not checkout the git repository, not needed |
14 | | - GIT_STRATEGY: none |
15 | | - rules: # Launch only on merge requests |
16 | | - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
17 | | - script: |
18 | | - - require_issue # launch the verification |
19 | | - |
20 | | -.basic-setup: |
21 | | - # Basic invocation of generic_anod_ci. |
22 | | - - generic_anod_ci |
23 | | - - cat /tmp/ci_env.sh |
24 | | - - . /tmp/ci_env.sh |
25 | | - |
26 | | -.basic-test-setup: |
27 | | - # Use of generic_anod_ci for the purposes of testing, assuming |
28 | | - # the presence of a package containing the build. |
29 | | - |
30 | | - # Unpack the built package |
31 | | - - (cd /tmp && tar -xzf $CI_PROJECT_DIR/wave-build-export.tar.gz) |
32 | | - # Make sure to remove the package, lest it be considered source by anod |
33 | | - - rm $CI_PROJECT_DIR/wave-build-export.tar.gz |
34 | | - |
35 | | - # Basic invocation of generic_anod_ci. |
36 | | - - generic_anod_ci |
37 | | - - cat /tmp/ci_env.sh |
38 | | - - . /tmp/ci_env.sh |
39 | | - |
40 | | - # Use the packaged components in our sandbox |
41 | | - - anod-copy-components /tmp/wave-build-export $ANOD_DEFAULT_SANDBOX_DIR |
42 | | - |
43 | | - # generic_anod_ci sets the resolver to "smart_resolver" - this conflicts |
44 | | - # with our intention to use the pre-build package(s): use the "minimal" |
45 | | - # resolver for this. |
46 | | - - anod tune --minimal --plan /tmp/plans |
47 | | - |
48 | | - |
49 | | -# Build and test with ANOD |
50 | | -# TODO: add a build and test based on Alire in parallel to this. |
51 | | -build: |
52 | | - services: |
53 | | - - image:systemgtk |
54 | | - - cpu:8 |
55 | | - stage: build |
56 | | - interruptible: true |
57 | | - rules: |
58 | | - - if: $CI_PIPELINE_SOURCE == 'push' |
59 | | - when: never |
60 | | - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
61 | | - - if: $CI_PIPELINE_SOURCE == 'pipeline' |
62 | | - script: |
63 | | - - !reference [.basic-setup] |
64 | | - |
65 | | - - echo -e "\e[0Ksection_start:`date +%s`:build_als[collapsed=true]\r\e[0Kanod build als" |
66 | | - - anod build als $ACI_TRACK_QUALIFIER |
67 | | - - echo -e "\e[0Ksection_end:`date +%s`:build_als\r\e[0K" |
68 | | - |
69 | | - - echo -e "\e[0Ksection_start:`date +%s`:build_vscode[collapsed=true]\r\e[0Kanod build vscode-extension" |
70 | | - # We pass --latest here because the vscode-extension will try to download |
71 | | - # the Windows binary (it's a multi-platform extension), and this binary |
72 | | - # might not be available right away. |
73 | | - - anod build vscode-extension $ACI_TRACK_QUALIFIER --minimal --latest |
74 | | - - echo -e "\e[0Ksection_end:`date +%s`:build_vscode\r\e[0K" |
75 | | - |
76 | | - # Export the components and make a package out of them |
77 | | - - anod-copy-components --standalone-export $ANOD_DEFAULT_SANDBOX_DIR /tmp/wave-build-export |
78 | | - - (cd /tmp/ && tar -czf $CI_PROJECT_DIR/wave-build-export.tar.gz wave-build-export) |
79 | | - |
80 | | - artifacts: |
81 | | - when: on_success |
82 | | - paths: |
83 | | - - wave-build-export.tar.gz |
84 | | - |
85 | | - |
86 | | -test-als: |
87 | | - services: |
88 | | - - image:systemgtk |
89 | | - - cpu:8 |
90 | | - stage: test |
91 | | - interruptible: true |
92 | | - rules: |
93 | | - - if: $CI_PIPELINE_SOURCE == 'push' |
94 | | - when: never |
95 | | - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
96 | | - - if: $CI_PIPELINE_SOURCE == 'pipeline' |
97 | | - script: |
98 | | - - !reference [.basic-test-setup] |
99 | | - |
100 | | - - echo -e "\e[0Ksection_start:`date +%s`:test_als[collapsed=true]\r\e[0Kanod test als" |
101 | | - # Run ALS tests |
102 | | - - anod test als $ACI_TRACK_QUALIFIER |
103 | | - |
104 | | - - ALS_BUILD_SPACE=$(anod info test als $ACI_TRACK_QUALIFIER --show working_dir) |
105 | | - - echo -e "\e[0Ksection_end:`date +%s`:test_als\r\e[0K" |
106 | | - |
107 | | - # Job artifacts must be produced in the project directory, so we do it at |
108 | | - # the end of the job to avoid changing Anod checkouts halfway through the |
109 | | - # job and triggering useless rebuilds. |
110 | | - # Process the als test report |
111 | | - - e3-testsuite-report |
112 | | - --failure-exit-code 1 |
113 | | - --xunit-output $CI_PROJECT_DIR/als_xunit_output.xml |
114 | | - $ALS_BUILD_SPACE/results/new/ || FAILED=true |
115 | | - # Include Anod logs |
116 | | - - cp -r $ANOD_DEFAULT_SANDBOX_DIR/log $CI_PROJECT_DIR/anod-logs |
117 | | - |
118 | | - - if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi |
119 | | - |
120 | | - artifacts: |
121 | | - when: always # Upload on errors too |
122 | | - reports: |
123 | | - junit: [als_xunit_output.xml] |
124 | | - paths: |
125 | | - - anod-logs/ |
126 | | - |
127 | | -test-vscode-extension: |
128 | | - services: |
129 | | - - image:systemgtk |
130 | | - - cpu:8 |
131 | | - stage: test |
132 | | - interruptible: true |
133 | | - rules: |
134 | | - - if: $CI_PIPELINE_SOURCE == 'push' |
135 | | - when: never |
136 | | - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
137 | | - - if: $CI_PIPELINE_SOURCE == 'pipeline' |
138 | | - script: |
139 | | - - !reference [.basic-test-setup] |
140 | | - |
141 | | - # Run VSCode extension tests |
142 | | - - echo -e "\e[0Ksection_start:`date +%s`:test_vscode[collapsed=true]\r\e[0Kanod test vscode-extension" |
143 | | - - anod test vscode-extension $ACI_TRACK_QUALIFIER --minimal |
144 | | - |
145 | | - - VSCODE_BUILD_SPACE=$(anod info test vscode-extension $ACI_TRACK_QUALIFIER --show working_dir) |
146 | | - - echo -e "\e[0Ksection_end:`date +%s`:test_vscode\r\e[0K" |
147 | | - |
148 | | - # Job artifacts must be produced in the project directory, so we do it at |
149 | | - # the end of the job to avoid changing Anod checkouts halfway through the |
150 | | - # job and triggering useless rebuilds. |
151 | | - # Process the vscode-extension test report |
152 | | - - e3-testsuite-report |
153 | | - --failure-exit-code 1 |
154 | | - --xunit-output $CI_PROJECT_DIR/vscode_xunit_output.xml |
155 | | - $VSCODE_BUILD_SPACE/results/ || FAILED=true |
156 | | - # Include Anod logs |
157 | | - - cp -r $ANOD_DEFAULT_SANDBOX_DIR/log $CI_PROJECT_DIR/anod-logs |
158 | | - |
159 | | - - if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi |
160 | | - |
161 | | - artifacts: |
162 | | - when: always # Upload on errors too |
163 | | - reports: |
164 | | - junit: [vscode_xunit_output.xml] |
165 | | - paths: |
166 | | - - anod-logs/ |
167 | | - |
168 | | -.run_ci_common: &run_ci_common |
169 | | - stage: run_downstream_ci |
170 | | - needs: ["test-als"] |
171 | | - rules: |
172 | | - - if: $CI_PIPELINE_SOURCE == 'push' |
173 | | - when: never |
174 | | - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
175 | | - when: manual |
176 | | - allow_failure: true |
177 | | - trigger: |
178 | | - strategy: depend |
179 | | - inherit: |
180 | | - variables: false |
181 | | - variables: |
182 | | - ACI_UPSTREAM_PROJECT_ID: $CI_PROJECT_ID |
183 | | - ACI_UPSTREAM_MERGE_REQUEST_IID: $CI_MERGE_REQUEST_IID |
184 | | - |
185 | | -run_gs_ci: |
186 | | - <<: *run_ci_common |
187 | | - trigger: |
188 | | - project: eng/ide/gnatstudio |
| 7 | +include: |
| 8 | + # Issue check |
| 9 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/check-issue@~latest |
| 10 | + |
| 11 | + # Build |
| 12 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/build@~latest |
| 13 | + inputs: |
| 14 | + anod-args: run build_$ACI_TRACK |
| 15 | + cpus: 16 |
| 16 | + image: systemgtk |
| 17 | + save-component: true |
| 18 | + |
| 19 | + # Testing of the ALS |
| 20 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/test@~latest |
| 21 | + inputs: |
| 22 | + job-name: als |
| 23 | + anod-args: run test_als_$ACI_TRACK |
| 24 | + image: systemgtk |
| 25 | + |
| 26 | + # Testing of the VSCode extension |
| 27 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/test@~latest |
| 28 | + inputs: |
| 29 | + job-name: vscode-extension |
| 30 | + anod-args: run test_vscode_extension_$ACI_TRACK |
| 31 | + image: systemgtk |
| 32 | + |
| 33 | + # Integration testsuite |
| 34 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/test@~latest |
| 35 | + inputs: |
| 36 | + job-name: integration-testsuite |
| 37 | + # Here we would like to use --latest as to reduce issues from unavailable |
| 38 | + # components, but we can't because it breaks the transfer of built |
| 39 | + # components between jobs using anod-copy-components. |
| 40 | + # |
| 41 | + # See https://gitlab.adacore-it.com/eng/ide/ada_language_server/-/merge_requests/1611#note_610445 |
| 42 | + anod-args: run test_integration_testsuite |
| 43 | + image: systemgtk |
| 44 | + cpus: 4 |
| 45 | + rules: |
| 46 | + # Does not work on edge |
| 47 | + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_TARGET_BRANCH_NAME != 'edge' |
| 48 | + |
| 49 | + # Optional testing of GNAT Studio |
| 50 | + - component: $CI_SERVER_FQDN/eng/gitlab-templates/test@~latest |
| 51 | + inputs: |
| 52 | + job-name: gs |
| 53 | + anod-args: run build_test_gs_$ACI_TRACK |
| 54 | + image: systemgtk |
| 55 | + stage: optional |
| 56 | + rules: |
| 57 | + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' |
| 58 | + when: manual |
| 59 | + allow_failure: true |
0 commit comments