-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
62 lines (58 loc) · 1.62 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
stages:
- build
- test
- scan
variables:
SONAR_SCANNER_VERSION: 5.0.1.3006
GIT_DEPTH: "0"
build:
stage: build
tags:
- linux
script:
- sudo apt-get update
- sudo rm -rf /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/debconf/*.dat /var/cache/apt/archives/lock
- sudo dpkg --configure -a
- sudo apt-get install -f
- sudo apt-get install -y python3-dev python3-pip libasound2-dev
- python3 setup.py sdist bdist_wheel
artifacts:
paths:
- dist/*.tar.gz
- dist/*.whl
test_job:
stage: test
tags:
- linux
script:
- sudo apt-get update
- sudo rm -rf /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/debconf/*.dat /var/cache/apt/archives/lock
- sudo dpkg --configure -a
- sudo apt-get install -f
- sudo apt-get install -y python3-dev python3-pip libasound2-dev
- sh testscript.sh
artifacts:
paths:
- coverage.xml
scan_job:
stage: scan
tags:
- linux
script:
- sudo apt-get update
- sudo rm -rf /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/debconf/*.dat /var/cache/apt/archives/lock
- sudo dpkg --configure -a
- sudo apt-get install -f
- sudo apt-get install -y unzip openjdk-17-jre
- pushd ~
- curl -o /tmp/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
- unzip -n /tmp/sonar-scanner.zip
- popd
- ~/sonar-scanner-${SONAR_SCANNER_VERSION}/bin/sonar-scanner -Dsonar.token=$SONAR_TOKEN
dependencies:
- test_job
artifacts:
paths:
- coverage.xml
variables:
GIT_STRATEGY: clone