-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
162 lines (154 loc) · 5.4 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
155
156
157
158
159
160
161
162
# Gitlab CI/CD for guardata
stages:
- quickQC
- test
- build
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
quality-control:
image: python:3.8-alpine
stage: quickQC
timeout: 4m
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
before_script:
- apk update
- apk add git build-base
- pip3 install --use-feature=2020-resolver pre-commit
script:
- pre-commit run --all-files --show-diff-on-failure
linux-tests:
image: ubuntu:focal
stage: test
timeout: 40m
needs: [quality-control]
except:
- tags
before_script:
- apt-get -y update
- DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install python3-pip python3-venv fuse postgresql postgresql-contrib libgl1-mesa-glx libglib2.0-0 libffi-dev
- /sbin/ldconfig
- service postgresql start
- adduser --disabled-password --gecos "" testuser
- chmod -R 777 ..
script:
- su testuser tests/LinuxTest.sh
windows-tests:
extends:
- .shared_windows_runners
stage: test
timeout: 40m
needs: [quality-control]
except:
- tags
before_script:
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco install -y --no-progress python --version=3.7.9
- choco install -y --no-progress winfsp --version=1.7.20172
- mkdir winfsp-test
- '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; curl -o winfsp-tests-1.7.20172.zip https://github.com/billziss-gh/winfsp/releases/download/v1.7/winfsp-tests-1.7.20172.zip'
- Expand-Archive winfsp-tests-1.7.20172.zip -DestinationPath winfsp-test
- RefreshEnv
- python.exe -m pip install -U pip
- python.exe -m pip install --use-feature=2020-resolver -r pre-requirements.txt
- $env:PATH+=";$env:CI_PROJECT_DIR\winfsp-test"
# build wheel
- python.exe setup.py bdist_wheel
- rm -R -Force guardata
# Install the guardata wheel with all dependencies
- $WHLfiles = Get-ChildItem "dist\guardata-*.whl" | ForEach-Object {$_.Name}
- python.exe -m pip install --use-feature=2020-resolver "dist\$WHLfiles[all]"
# Check dependency compatibility
- python.exe -m pip check guardata[all]
# Check winfsp-tests availability
- python.exe -c "import winfspy.tests.winfsp_tests"
script:
- python.exe -m pytest --log-level=DEBUG --durations=10 -v tests -n auto --max-worker-restart=0 -x
- python.exe -m pytest --log-level=DEBUG --durations=10 -v tests --runmountpoint --runslow -m mountpoint -x
- $env:QT_QPA_PLATFORM="offscreen"
- python.exe -m pytest --log-level=DEBUG --durations=10 -v tests --runmountpoint --runslow --rungui -m gui -x -n 1
- python.exe -m pytest --log-level=DEBUG --durations=10 -v tests --runslow -m slow -n auto --max-worker-restart=0 -x
pip-build:
image: ubuntu:focal
only:
- tags
stage: build
timeout: 5m
before_script:
- apt-get -y update
- DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install python3-pip python3-venv fuse postgresql postgresql-contrib libgl1-mesa-glx libglib2.0-0 libffi-dev
- /sbin/ldconfig
- rm -Rf tests
- rm -Rf backendService
- rm -Rf guardata/test_utils
- python3 -m pip install -U pip
- python3 -m venv venv_build
- ./venv_build/bin/python3 -m pip install -r pre-requirements.txt
script:
- echo __version__=\"$CI_COMMIT_TAG\" > guardata/_version.py
- cat CHANGELOG.rst >> README.rst
- ./venv_build/bin/python3 setup.py bdist_wheel
- pip3 install --use-feature=2020-resolver --user virtualenv
- python3 -m venv venv_test
- source venv_test/bin/activate
- pip3 install -r pre-requirements.txt
- pip3 install --use-feature=2020-resolver $(ls dist/guardata-*.whl)[client]
- mkdir empty
- cd empty
- guardata --version
artifacts:
paths:
- dist/guardata-*.whl
windows-build:
extends:
- .shared_windows_runners
only:
- tags
stage: build
timeout: 30m
before_script:
- rm -R -Force guardata/test_utils
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- choco install -y --no-progress python --version=3.7.9
- choco install -y --no-progress nsis --version=3.06.1
- RefreshEnv
- $pytver = "__version__ = `"${CI_COMMIT_TAG}`"`n"
- Out-File -FilePath guardata\_version.py -InputObject $pytver -Encoding ascii
- cd packaging/win32/
- curl -o winfsp-1.7.20172.msi https://github.com/billziss-gh/winfsp/releases/download/v1.7/winfsp-1.7.20172.msi
- .\Invoke-Environment.ps1 '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
- $env:PATH+=";C:\Program Files (x86)\NSIS"
script:
- python.exe freeze_guardata.py ..\\..
- makensis.exe installer.nsi
artifacts:
paths:
- packaging/win32/build/guardata*-setup.exe
snap-build:
image: kyrofa/github-snap-builder:core18
only:
- tags
stage: build
timeout: 15m
before_script:
- sudo apt-get -y update
- cp -R packaging/snap snapbuild
- cat CHANGELOG.rst >> README.rst
- cd snapbuild
- mkdir src
- cp -R ../guardata src
- cp ../setup.py src
- cp ../README.rst src
script:
- sed -i "s#^\\(__version__ = \\).*\$#\\1'$CI_COMMIT_TAG'#" src/guardata/_version.py
- sed -i "s/__GUARDATA_VERSION__/$CI_COMMIT_TAG/" snap/snapcraft.yaml
- snapcraft --destructive-mode
artifacts:
paths:
- snapbuild/guardata*.snap