-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
154 lines (141 loc) · 5 KB
/
.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
147
148
149
150
151
152
153
154
image: docker.uib.gmbh/opsi/dev/pybuilder:uib-python-3.11
stages:
- test
- build
- viruscheck
test:pytest-darwin:
stage: test
tags:
- catalina-py311-x64
script:
- poetry lock --no-update
- poetry install
- poetry run pytest --tb=short -o junit_family=xunit2 --junitxml=testreport.xml --cov-append --cov ocainstallationhelper --cov-report term --cov-report xml -v
- mv .coverage coverage_darwin
artifacts:
name: 'oca-installation-helper_test_darwin'
paths:
- testreport.xml
- coverage_darwin
expire_in: 3 days
test:pytest-windows:
stage: test
tags:
- win10-py311-x86
script:
- poetry lock --no-update
- poetry install
- poetry run pytest --tb=short -o junit_family=xunit2 --junitxml=testreport.xml --cov-append --cov ocainstallationhelper --cov-report term --cov-report xml -v
- Rename-Item -Path .coverage -NewName coverage_windows
artifacts:
name: 'oca-installation-helper_test_windows'
paths:
- testreport.xml
- coverage_windows
expire_in: 3 days
test:pytest-linux:
stage: test
script:
- poetry lock --no-update
- poetry install
- poetry run pytest --tb=short -o junit_family=xunit2 --junitxml=testreport.xml --cov-append --cov ocainstallationhelper --cov-report term --cov-report xml -v
- mv .coverage coverage_linux
artifacts:
name: 'oca-installation-helper_test_linux'
paths:
- testreport.xml
- coverage_linux
reports:
junit: testreport.xml
expire_in: 3 days
test:pylint-pytest:
stage: test
needs:
# We want to combine test coverage from all test jobs
- job: test:pytest-windows
artifacts: true
- job: test:pytest-darwin
artifacts: true
- job: test:pytest-linux
artifacts: true
script:
- apt-get update
- apt-get --yes --allow-downgrades install libsqlite3-0=3.16.2-5+deb9u1
- apt-get --yes install sqlite3
- poetry lock --no-update
- poetry install
- poetry run ruff check ocainstallationhelper tests
- poetry run mypy ocainstallationhelper tests
- for db in coverage_*; do sqlite3 $db 'update file set path=replace(substr(path,instr(path,"ocainstallationhelper")),"\","/");'; done
- echo -e '[run]\nrelative_files = True\n' > .coveragerc
- poetry run coverage combine coverage_*
- poetry run coverage xml
- poetry run coverage report
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/'
artifacts:
name: 'oca-installation-helper_test'
paths:
- coverage.xml
expire_in: 3 days
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
build:pyinstaller-darwin-x64:
stage: build
tags:
- catalina-py311-x64
script:
- poetry lock --no-update
- poetry install
- poetry run opsi-dev-cli -l info pyinstaller build
- ./dist/oca-installation-helper --version
- '[ "$CI_COMMIT_TAG" = "" ] && opsi-dev-cli -l info binary push dist/oca-installation-helper --prerelease="$CI_JOB_ID"'
- '[ "$CI_COMMIT_TAG" = "" ] || opsi-dev-cli -l info binary push dist/oca-installation-helper'
build:pyinstaller-linux-x64:
stage: build
script:
- poetry lock --no-update
- poetry install
- poetry run opsi-dev-cli -l info pyinstaller build
- ./dist/oca-installation-helper --version
- '[ "$CI_COMMIT_TAG" = "" ] && opsi-dev-cli -l info binary push dist/oca-installation-helper --prerelease="$CI_JOB_ID"'
- '[ "$CI_COMMIT_TAG" = "" ] || opsi-dev-cli -l info binary push dist/oca-installation-helper'
build:pyinstaller-linux-arm64:
stage: build
tags:
- linux-arm64
script:
- poetry lock --no-update
- poetry install
- poetry run opsi-dev-cli -l info pyinstaller build
- ./dist/oca-installation-helper --version
- '[ "$CI_COMMIT_TAG" = "" ] && opsi-dev-cli -l info binary push dist/oca-installation-helper --prerelease="$CI_JOB_ID"'
- '[ "$CI_COMMIT_TAG" = "" ] || opsi-dev-cli -l info binary push dist/oca-installation-helper'
build:pyinstaller-windows-x86:
stage: build
tags:
- win10-py311-x86
script:
- Invoke-WebRequest -UseBasicParsing -Uri "$OPSIDEVTOOLS_URL_WINDOWS_X86" -OutFile opsi-dev-tools.zip
- Expand-Archive opsi-dev-tools.zip -DestinationPath .
- Copy-Item opsi-dev-tool.exe opsi-dev-cli.exe
- poetry lock --no-update
- poetry install
- poetry run .\opsi-dev-cli -l info pyinstaller build
- .\opsi-dev-tool -l info --signserver-sign dist\oca-installation-helper.exe
# Check if binary is working
- dist\oca-installation-helper.exe --version
# Push to binaryindex
- if (! $CI_COMMIT_TAG) {.\opsi-dev-cli -l info binary push dist\oca-installation-helper.exe --prerelease="$CI_JOB_ID"}
- if ($CI_COMMIT_TAG) {.\opsi-dev-cli -l info binary push dist\oca-installation-helper.exe}
artifacts:
name: 'windows_binary'
paths:
- dist\oca-installation-helper.exe
viruscheck:virustotal:
stage: viruscheck
script:
- opsi-dev-cli -l info --output-format simple virustotal check dist/oca-installation-helper.exe --allow-detections=8
only:
- tags