1
1
stages :
2
- - build_and_test
2
+ - build
3
+ - test
3
4
- check
4
5
- run_downstream_ci
5
6
@@ -17,18 +18,41 @@ issue-check:
17
18
- require_issue # launch the verification
18
19
19
20
.basic-setup :
20
- # Use generic_anod_ci here .
21
+ # Basic invocation of generic_anod_ci .
21
22
- generic_anod_ci
22
23
- cat /tmp/ci_env.sh
23
24
- . /tmp/ci_env.sh
24
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
+
25
49
# Build and test with ANOD
26
50
# TODO: add a build and test based on Alire in parallel to this.
27
- build_and_test :
51
+ build :
28
52
services :
29
53
- image:systemgtk
30
54
- cpu:8
31
- stage : build_and_test
55
+ stage : build
32
56
interruptible : true
33
57
rules :
34
58
- if : $CI_PIPELINE_SOURCE == 'push'
@@ -49,22 +73,37 @@ build_and_test:
49
73
- anod build vscode-extension $ACI_TRACK_QUALIFIER --minimal --latest
50
74
- echo -e "\e[0Ksection_end:`date +%s`:build_vscode\r\e[0K"
51
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
+
52
100
- echo -e "\e[0Ksection_start:`date +%s`:test_als[collapsed=true]\r\e[0Kanod test als"
53
101
# Run ALS tests
54
102
- anod test als $ACI_TRACK_QUALIFIER
55
103
56
- # TODO: it would be nice to have a simpler way of getting this info
57
- - ALS_BUILD_SPACE_NAME=`anod eval als --primitive test build_space_name $ACI_TRACK_QUALIFIER | tr -d "'"`
58
- - ALS_BUILD_SPACE=$ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$ALS_BUILD_SPACE_NAME
104
+ - ALS_BUILD_SPACE=$(anod info test als $ACI_TRACK_QUALIFIER --show working_dir)
59
105
- echo -e "\e[0Ksection_end:`date +%s`:test_als\r\e[0K"
60
106
61
- - echo -e "\e[0Ksection_start:`date +%s`:test_vscode[collapsed=true]\r\e[0Kanod test vscode-extension"
62
- # Run VSCode tests
63
- - anod test vscode-extension --qualifier=$ACI_TRACK_QUALIFIER --minimal
64
- - VSCODE_BUILD_SPACE_NAME=`anod eval --primitive test --qualifier=$ACI_TRACK_QUALIFIER vscode-extension build_space_name | tr -d "'"`
65
- - VSCODE_BUILD_SPACE=$ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$VSCODE_BUILD_SPACE_NAME
66
- - echo -e "\e[0Ksection_end:`date +%s`:test_vscode\r\e[0K"
67
-
68
107
# Job artifacts must be produced in the project directory, so we do it at
69
108
# the end of the job to avoid changing Anod checkouts halfway through the
70
109
# job and triggering useless rebuilds.
@@ -74,6 +113,44 @@ build_and_test:
74
113
--failure-exit-code 1
75
114
--xunit-output $CI_PROJECT_DIR/als_xunit_output.xml
76
115
$ALS_BUILD_SPACE/results/new/ || FAILED=true
116
+ # Include Anod logs
117
+ - cp -r $ANOD_DEFAULT_SANDBOX_DIR/log $CI_PROJECT_DIR/anod-logs
118
+ - echo -e "\e[0Ksection_end:`date +%s`:prepare_artifacts\r\e[0K"
119
+
120
+ - if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
121
+
122
+ artifacts :
123
+ when : always # Upload on errors too
124
+ reports :
125
+ junit : [als_xunit_output.xml]
126
+ paths :
127
+ - anod-logs/
128
+
129
+ test-vscode-extension :
130
+ services :
131
+ - image:systemgtk
132
+ - cpu:8
133
+ stage : test
134
+ interruptible : true
135
+ rules :
136
+ - if : $CI_PIPELINE_SOURCE == 'push'
137
+ when : never
138
+ - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
139
+ - if : $CI_PIPELINE_SOURCE == 'pipeline'
140
+ script :
141
+ - !reference [.basic-test-setup]
142
+
143
+ # Run VSCode extension tests
144
+ - echo -e "\e[0Ksection_start:`date +%s`:test_vscode[collapsed=true]\r\e[0Kanod test vscode-extension"
145
+ - anod test vscode-extension --qualifier=$ACI_TRACK_QUALIFIER --minimal
146
+
147
+ - VSCODE_BUILD_SPACE=$(anod info test vscode-extension $ACI_TRACK_QUALIFIER --show working_dir)
148
+ - echo -e "\e[0Ksection_end:`date +%s`:test_vscode\r\e[0K"
149
+
150
+ # Job artifacts must be produced in the project directory, so we do it at
151
+ # the end of the job to avoid changing Anod checkouts halfway through the
152
+ # job and triggering useless rebuilds.
153
+ - echo -e "\e[0Ksection_start:`date +%s`:prepare_artifacts[collapsed=true]\r\e[0KPrepare job artifacts"
77
154
# Process the vscode-extension test report
78
155
- e3-testsuite-report
79
156
--failure-exit-code 1
@@ -83,15 +160,12 @@ build_and_test:
83
160
- cp -r $ANOD_DEFAULT_SANDBOX_DIR/log $CI_PROJECT_DIR/anod-logs
84
161
- echo -e "\e[0Ksection_end:`date +%s`:prepare_artifacts\r\e[0K"
85
162
86
- - if [ ! -z ${FAILED+x} ]; then cat $CI_PROJECT_DIR/als_xunit_output.xml; fi
87
- - if [ ! -z ${FAILED+x} ]; then cat $CI_PROJECT_DIR/vscode_xunit_output.xml; fi
88
-
89
163
- if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
90
164
91
165
artifacts :
92
166
when : always # Upload on errors too
93
167
reports :
94
- junit : [als_xunit_output.xml, vscode_xunit_output.xml]
168
+ junit : [vscode_xunit_output.xml]
95
169
paths :
96
170
- anod-logs/
97
171
0 commit comments