-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwindows.gitlab-ci.yml
146 lines (143 loc) · 6.42 KB
/
windows.gitlab-ci.yml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
workflow:
auto_cancel:
on_job_failure: all
install_snap:
tags:
- windows
stage: test
cache: []
variables:
DL_DIR: 'C:\Users\Public\Documents'
NEXUS_URL: "https://nexus.snap-ci.ovh/repository/snap-maven-releases/org/esa/snap/installers-snapshot/snap_all_windows/%VERSION%"
SNAP_DIR: 'C:\\Users\\Public\\Documents\\snap'
SNAP_INSTALLER_EXE: "snap_all_windows-%VERSION%.exe"
before_script:
# print local variables
- echo DL_DIR = %DL_DIR%
- echo NEXUS_URL = %NEXUS_URL%
- echo SNAP_DIR = %SNAP_DIR%
- echo SNAP_INSTALLER_EXE = %SNAP_INSTALLER_EXE%
- echo VERSION = %VERSION%
script:
# remove old SNAP installer file
- DEL /Q /F /S %DL_DIR%\%SNAP_INSTALLER_EXE%
# Download SNAP installer application from Nexus
- curl --progress-bar "%NEXUS_URL%/%SNAP_INSTALLER_EXE%" >> "%DL_DIR%\%SNAP_INSTALLER_EXE%"
# Check MD5 checksums of SNAP installer executable files (remote vs downloaded).
- CALL checkMD5.bat
- echo "return from checkMD5.bat with code %md5RetVal%"
- |
IF !md5RetVal! EQU 0 (
REM Install SNAP aplication on destination Windows VM
echo "Install SNAP (version %VERSION%)" && "%DL_DIR%\%SNAP_INSTALLER_EXE%" -q -dir "%SNAP_DIR%" -console -overwrite -v
echo "Post install - copy snap.properties file" && xcopy "%DL_DIR%\snap.properties" "%SNAP_DIR%\etc" /Y
) ELSE (
echo "ERROR - Do not execute installation of SNAP (version %VERSION%) - the installer file is corrupt."
echo "Cancel the job '%CI_JOB_NAME%' (and entire pipeline)..."
exit %md5RetVal%
)
test_windows:
tags:
- windows
stage: test
cache: []
variables:
SCOPE: daily
REPORT_DIR: result
TEST_DATA_DIR: 'D:\\testData'
SNAP_DIR: 'C:\\Users\\Public\\Documents\\snap'
TEMP_DIR: 'D:\\tmp'
TAG: master
PROPERTIES_PATH: win.conf
TEST_DATA_LIST: singleTestData.txt
JAVA_HOME: C:\\Program Files\\Zulu\\zulu-21
JAVA_OPTIONS: >-
-Dncsa.hdf.hdflib.HDFLibrary.hdflib=%SNAP_DIR%\\snap\\modules\\lib\\amd64\\jhdf.dll
-Dncsa.hdf.hdf5lib.H5.hdf5lib=%SNAP_DIR%\\snap\modules\\lib\amd64\\jhdf5.dll
-Dfile.encoding=Windows-1252
CLASSPATH: gpt-tests-executer\\target\\gpt-test-exec.jar
# output upload and download progress every 2 seconds
TRANSFER_METER_FREQUENCY: "2s"
# Use fast compression for artifacts, resulting in larger archives
ARTIFACT_COMPRESSION_LEVEL: "slowest"
before_script:
- echo username = %USERNAME%
# Build maven project
- call mvn %MAVEN_CLI_OPTS% package install
# Print local variables
- echo CI_PROJECT_DIR = %CI_PROJECT_DIR%
- echo REPORT_DIR = %REPORT_DIR%
- echo SCOPE = %SCOPE%
- echo SNAP_DIR = %SNAP_DIR%
# Clean old report
- rd /s /q %REPORT_DIR%
- mkdir %REPORT_DIR% && mkdir %REPORT_DIR%\report && mkdir %REPORT_DIR%\report\output
- python -m venv snapenv && call .\snapenv\Scripts\activate.bat && pip3 install -r %CI_PROJECT_DIR%\requirements.txt
# Produce a list of tests to run
- python %CI_PROJECT_DIR%\pygpt\filter_json.py gpt-tests-resources\tests %SCOPE% %REPORT_DIR%
script:
- run_tests.bat
after_script:
# Remove heavy images
- DEL /Q /F /S %REPORT_DIR%\report\output\*.zip
- DEL /Q /F /S %REPORT_DIR%\report\output\*.dim
- DEL /Q /F /S %TEMP%\*
needs: ["install_snap"]
artifacts:
when: always
expire_in: "1 hour"
paths:
- result
report:
tags:
- windows
stage: report
cache: []
rules:
- if: $PLATFORM == 'windows' && $SCOPE != 'CItest'
when: always
- when: never
variables:
REPORT_DIR: result
# Output upload and download progress every 2 seconds
TRANSFER_METER_FREQUENCY: "2s"
# Use fast compression for artifacts, resulting in larger archives
ARTIFACT_COMPRESSION_LEVEL: "fast"
# Use no compression for caches
CACHE_COMPRESSION_LEVEL: "fastest"
# Set maximum duration of cache upload and download
CACHE_REQUEST_TIMEOUT: 5
DEST_DIR: public\windows
# version to display in HTML report
DISPLAY_VERSION: snap:%CI_COMMIT_REF_NAME%
before_script:
- echo S3_REPORTS = %S3_REPORTS%
- echo REPORT_DIR = %REPORT_DIR%
script:
- echo "Copy assets for report generation"
- mkdir %CI_PROJECT_DIR%\%REPORT_DIR%\report\json %CI_PROJECT_DIR%\%REPORT_DIR%\report\performances %CI_PROJECT_DIR%\%REPORT_DIR%\report\images
- xcopy /Y "%CI_PROJECT_DIR%\%REPORT_DIR%\report\output\json\*.json" "%CI_PROJECT_DIR%\%REPORT_DIR%\report\json\"
- xcopy /E /H /C /I "%CI_PROJECT_DIR%\%REPORT_DIR%\report\output\performances" "%CI_PROJECT_DIR%\%REPORT_DIR%\report\performances\"
- xcopy /Y "%CI_PROJECT_DIR%\%REPORT_DIR%\report\output\*.txt" "%CI_PROJECT_DIR%\%REPORT_DIR%\report\"
- rmdir /Y /S "%CI_PROJECT_DIR%\%REPORT_DIR%\report\output"
- mkdir %CI_PROJECT_DIR%\result\report\css %CI_PROJECT_DIR%\result\report\icons %CI_PROJECT_DIR%\result\report\js
- xcopy /Y "%CI_PROJECT_DIR%\pygpt\statics\css\*.css*" "%CI_PROJECT_DIR%\result\report\css\"
- xcopy /Y "%CI_PROJECT_DIR%\pygpt\statics\icons\*.jpg" "%CI_PROJECT_DIR%\result\report\icons\"
- xcopy /Y "%CI_PROJECT_DIR%\pygpt\statics\icons\*.png" "%CI_PROJECT_DIR%\result\report\icons\"
- xcopy /Y "%CI_PROJECT_DIR%\pygpt\statics\js\*.js" "%CI_PROJECT_DIR%\result\report\js\"
- echo "Generate HTML report (for Windows)"
# Execute: python pygpt\report_utils.py <template_dir> <base_path> <scope> <display_version>
- python pygpt\report_utils.py pygpt\templates %CI_PROJECT_DIR%\%REPORT_DIR%\report %SCOPE% %DISPLAY_VERSION%
- rd /s /q %CI_PROJECT_DIR%\%DEST_DIR%
- mkdir %CI_PROJECT_DIR%\public %CI_PROJECT_DIR%\%DEST_DIR%
# Remove previous report (for Windows) from S3 cloud (https://s3.sbg.io.cloud.ovh.net)
- '"C:\Program Files\Amazon\AWSCLIV2\aws.exe" s3 rm "s3://%S3_REPORTS%/windows" --recursive --endpoint-url https://s3.sbg.io.cloud.ovh.net --region sbg"'
# Upload HTML report to S3 cloud (https://snap-reports.s3.sbg.io.cloud.ovh.net/windows/index.html)
- '"C:\Program Files\Amazon\AWSCLIV2\aws.exe" s3 sync %CI_PROJECT_DIR%\%REPORT_DIR%\report "s3://%S3_REPORTS%/windows" --endpoint-url https://s3.sbg.io.cloud.ovh.net --region sbg --acl public-read'
after_script:
# Update database of web application for results comparison (statistics) (https://reports.snap-ci.ovh/?#/branches)
- '%CI_PROJECT_DIR%\update_database.bat'
artifacts:
expire_in: 1 day
paths:
- '%CI_PROJECT_DIR%\%REPORT_DIR%\report'