-
Notifications
You must be signed in to change notification settings - Fork 4
/
darwin.gitlab-ci.yml
95 lines (94 loc) · 3.46 KB
/
darwin.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
test_mac:
tags:
- mac
stage: test
rules:
- if: $PLATFORM == 'darwin'
when: always
- when: never
# - if: $CI_COMMIT_TAG
# variables:
# DL_URL: https://nexus.snap-ci.ovh/repository/snap-maven-releases/org/esa/snap/installers/snap_all_macos/RC10/snap_all_macos-RC10.dmg
variables:
SCOPE: daily
SNAP_DIR: /Users/otb/Applications/snap
REPORT_DIR: ./result
TAG: master
PROPERTIES_PATH: $CI_PROJECT_DIR/mac.conf
SNAP_INSTALLER: snap_all_macos_archive-$VERSION.dmg
TEST_DATA_LIST: singleTestData.txt
TEST_DATA_DIR: "/Volumes/snap-ext/SNAP/testData"
JAVA_HOME: /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home
MAVEN_CLI_OPTS: >-
--no-transfer-progress
--batch-mode
--errors
--fail-at-end
--show-version
-DdeployAtEnd=false
-Dmaven.wagon.http.ssl.insecure=true
-Dmaven.wagon.http.ssl.allowall=true
DL_URL: https://nexus.snap-ci.ovh/repository/snap-maven-releases/org/esa/snap/installers-snapshot/snap_all_macos_archive/$VERSION/snap_all_macos_archive-$VERSION.dmg
before_script:
- mvn $MAVEN_CLI_OPTS package install
- ls "${CI_PROJECT_DIR}/gpt-tests-executer/target"
- rm -rf $REPORT_DIR
- mkdir -p $TEST_DATA_DIR/$SCOPE $REPORT_DIR $REPORT_DIR/report $REPORT_DIR/report/output
- python3 -m venv snap
- source snap/bin/activate
- pip3 install -r $CI_PROJECT_DIR/requirements.txt
- curl --progress-bar "${DL_URL}" >> "${CI_PROJECT_DIR}/${SNAP_INSTALLER}"
- hdiutil attach ${CI_PROJECT_DIR}/${SNAP_INSTALLER}
- '"/Volumes/esa-snap 1/ESA SNAP.app/Contents/MacOS/JavaApplicationStub" -q -console -dir $SNAP_DIR'
- ls $SNAP_DIR/bin
- python3 $CI_PROJECT_DIR/pygpt/filter_json.py gpt-tests-resources/tests $SCOPE $REPORT_DIR
script:
- $CI_PROJECT_DIR/prepare.sh "${REPORT_DIR}" "${TEST_DATA_DIR}" "${TEST_DATA_LIST}" "${S3_BUCKET}" "${S3_ARGS}" "${CI_PROJECT_DIR}"
after_script:
- hdiutil eject /dev/disk3
artifacts:
when: always
expire_in: "3 days"
paths:
- "${REPORT_DIR}/report"
report:
stage: report
tags:
- mac
rules:
- if: $PLATFORM == 'darwin' && $SCOPE != 'CItest'
when: always
- when: never
- if: $CI_COMMIT_BRANCH == 'master'
variables:
VERSION: snap:master
- if: $CI_COMMIT_TAG
variables:
VERSION: snap:$CI_COMMIT_TAG
cache: []
variables:
# 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
before_script:
- pip3 install -r $CI_PROJECT_DIR/requirements.txt
script:
- echo "Copy assets for report generation in result/report"
- ls result/report/output/
- cp -rf result/report/output/* result/report
- cp -rf pygpt/statics/* result/report
- ls result/report
- echo "Generate report"
- python3 pygpt/report_utils.py pygpt/templates result/report $SCOPE snap:master
# Upload to s3
- aws s3 rm "s3://${S3_REPORTS}/macos" --recursive --endpoint-url https://s3.sbg.io.cloud.ovh.net --region sbg
- aws s3 sync result/report "s3://${S3_REPORTS}/macos" --endpoint-url https://s3.sbg.io.cloud.ovh.net --region sbg --acl public-read
artifacts:
expire_in: 1 day
paths:
- result/report